diff options
| author | Tannin <devnull@localhost> | 2014-07-17 20:04:22 +0200 |
|---|---|---|
| committer | Tannin <devnull@localhost> | 2014-07-17 20:04:22 +0200 |
| commit | 4e5a67fc063243c4c10e04b5f601108dd01357f3 (patch) | |
| tree | e327a00a93b6d72c286830a7769cd7be9b15e3f0 /src/overwriteinfodialog.cpp | |
| parent | 67b0268e700072b9ee273a40251b422a8f55c3ba (diff) | |
- bugfix: broke qt4 compatibility in trying to support qt5
- bugfix: overwrite dialog displayed system drives if the overwrite directory didn't exist
- bugfix: ini tweak activation wasn't saved
Diffstat (limited to 'src/overwriteinfodialog.cpp')
| -rw-r--r-- | src/overwriteinfodialog.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/overwriteinfodialog.cpp b/src/overwriteinfodialog.cpp index 2ba81633..16242506 100644 --- a/src/overwriteinfodialog.cpp +++ b/src/overwriteinfodialog.cpp @@ -72,19 +72,17 @@ private: OverwriteInfoDialog::OverwriteInfoDialog(ModInfo::Ptr modInfo, QWidget *parent) : QDialog(parent), ui(new Ui::OverwriteInfoDialog), m_FileSystemModel(NULL), - m_DeleteAction(NULL), m_RenameAction(NULL), m_OpenAction(NULL), - m_ModInfo(modInfo) + m_DeleteAction(NULL), m_RenameAction(NULL), m_OpenAction(NULL) { ui->setupUi(this); this->setWindowModality(Qt::NonModal); - QString path = modInfo->absolutePath(); m_FileSystemModel = new MyFileSystemModel(this); m_FileSystemModel->setReadOnly(false); - m_FileSystemModel->setRootPath(path); + setModInfo(modInfo); ui->filesView->setModel(m_FileSystemModel); - ui->filesView->setRootIndex(m_FileSystemModel->index(path)); + ui->filesView->setRootIndex(m_FileSystemModel->index(modInfo->absolutePath())); ui->filesView->setColumnWidth(0, 250); m_DeleteAction = new QAction(tr("&Delete"), ui->filesView); @@ -102,6 +100,16 @@ OverwriteInfoDialog::~OverwriteInfoDialog() delete ui; } +void OverwriteInfoDialog::setModInfo(ModInfo::Ptr modInfo) +{ + m_ModInfo = modInfo; + if (QDir(modInfo->absolutePath()).exists()) { + m_FileSystemModel->setRootPath(modInfo->absolutePath()); + } else { + throw MyException(tr("%1 not found").arg(modInfo->absolutePath())); + } +} + bool OverwriteInfoDialog::recursiveDelete(const QModelIndex &index) { for (int childRow = 0; childRow < m_FileSystemModel->rowCount(index); ++childRow) { |
