From: hama Date: Wed, 27 May 2015 20:33:42 +0000 (+0200) Subject: Crash in option dialog, permission search removed X-Git-Url: https://gitweb.hamatoma.de/?a=commitdiff_plain;h=64a535ccff1409734cd02e7c482c79c2bebeaf09;p=reqt Crash in option dialog, permission search removed --- diff --git a/appl/refind/dialogoptions.cpp b/appl/refind/dialogoptions.cpp index 61bda5f..0791863 100644 --- a/appl/refind/dialogoptions.cpp +++ b/appl/refind/dialogoptions.cpp @@ -177,10 +177,16 @@ void DialogOptions::down(){ */ void DialogOptions::fillTable(){ int count = m_contextHandlers.list().size(); - ui->tableWidget->setRowCount(count); + int rowCount = 0; + for (int row = 0; row < count; row++){ + ContextHandler* handler = m_contextHandlers.list().at(row); + if (handler->intrinsicType() == ContextHandler::IT_UNDEF) + rowCount++; + } + ui->tableWidget->setRowCount(rowCount); QString value; QList < QString > dirMode; - for (int row = 0; row < count; row++){ + for (int row = 0; row < rowCount; row++){ ContextHandler* handler = m_contextHandlers.list().at(row); if (handler->intrinsicType() == ContextHandler::IT_UNDEF){ ui->tableWidget->setItem(row, COL_TITLE, @@ -222,7 +228,8 @@ void DialogOptions::fillContextHandler(int row, ContextHandler& handler){ */ void DialogOptions::fromTable(){ m_contextHandlers.clear(); - for (int row = 0; row < ui->tableWidget->rowCount(); row++){ + int count = ui->tableWidget->rowCount(); + for (int row = 0; row < count; row++){ ContextHandler* handler = new ContextHandler; fillContextHandler(row, *handler); m_contextHandlers.list().append(handler); diff --git a/appl/refind/mainwindow.cpp b/appl/refind/mainwindow.cpp index c132247..3b8d911 100644 --- a/appl/refind/mainwindow.cpp +++ b/appl/refind/mainwindow.cpp @@ -171,9 +171,11 @@ void MainWindow::baseDirToClipboard(){ * * @param row the row number * @param withNode true: the node will be appended to the result + * @param uriFormat true: example: file:///u:/tmp/file.txt
+ * false: example: u:\tmp\file.txt * @return the absolute path of the file given by the row */ -QString MainWindow::buildAbsPath(int row, bool withNode){ +QString MainWindow::buildAbsPath(int row, bool withNode, bool uriFormat){ QString rc(m_lastBaseDir.absolutePath()); QString value = cellAsText(row, TC_PATH); if (!value.isEmpty()){ @@ -184,6 +186,12 @@ QString MainWindow::buildAbsPath(int row, bool withNode){ ReQStringUtil::ensureLastChar(rc, '/'); rc += cellAsText(row, TC_NODE); } + if (uriFormat){ + rc = "file://" + rc; +#if defined WIN32 + rc = rc.replace('\\', '/'); +#endif + } return rc; } @@ -201,18 +209,6 @@ QDir::Filters MainWindow::buildFileTypes(){ rc |= QDir::Dirs | QDir::Files; if (!ui->checkBoxLinks->isChecked()) rc |= QDir::NoSymLinks; - if (ui->checkBoxHidden) - rc |= QDir::Hidden | QDir::System; - QDir::Filters mask = 0; - if (ui->checkBoxWritable->isChecked()) - mask |= QDir::Writable; - if (ui->checkBoxReadable->isChecked()) - mask |= QDir::Readable; - if (ui->checkBoxExecutable->isChecked()) - mask |= QDir::Executable; - if (mask == 0) - mask |= QDir::PermissionMask; - rc |= mask; return rc; } @@ -361,7 +357,7 @@ void MainWindow::fileDragging(){ for (it = ranges.begin(); it != ranges.end(); ++it){ for (int row = (*it).topRow(); row <= (*it).bottomRow(); row++){ isDir = cellAsText(row, TC_SIZE).isEmpty(); - QUrl url(buildAbsPath(row, true)); + QUrl url(buildAbsPath(row, true, true)); urls.append(url); if (isDir) dirs++; @@ -710,13 +706,9 @@ ui->comboBoxTextPattern->setCurrentText(""); ui->checkBoxBinaryFiles->setChecked(false); ui->checkBoxDirs->setChecked(true); ui->checkBoxFiles->setChecked(true); -ui->checkBoxHidden->setChecked(false); ui->checkBoxLinks->setChecked(true); -ui->checkBoxReadable->setChecked(true); ui->checkBoxRegExpr->setChecked(false); ui->checkBoxTextIgnoreCase->setChecked(false); -ui->checkBoxWritable->setChecked(true); -ui->checkBoxExecutable->setChecked(true); } /** diff --git a/appl/refind/mainwindow.hpp b/appl/refind/mainwindow.hpp index 2a906d2..d93c9b8 100644 --- a/appl/refind/mainwindow.hpp +++ b/appl/refind/mainwindow.hpp @@ -45,7 +45,8 @@ public: ~MainWindow(); public: - void fileDragging();private slots: + void fileDragging(); +private slots: void about(); void absPathToClipboard(); void baseDirToClipboard(); @@ -68,7 +69,7 @@ public: private: void prepareContextMenu(); - QString buildAbsPath(int row, bool withNode = false); + QString buildAbsPath(int row, bool withNode = false, bool uriFormat = false); QDir::Filters buildFileTypes(); void buildGlobalPlaceholders(QMap & hash); QString cellAsText(int row, int col); diff --git a/appl/refind/refind.ico b/appl/refind/refind.ico new file mode 100755 index 0000000..101d995 Binary files /dev/null and b/appl/refind/refind.ico differ