From: hama Date: Sun, 12 Apr 2015 18:31:26 +0000 (+0200) Subject: refind: filtering works, tooltips X-Git-Url: https://gitweb.hamatoma.de/?a=commitdiff_plain;h=d49d561883633fdc9481a9b3af46881ea4a0709d;p=reqt refind: filtering works, tooltips --- diff --git a/appl/refind/filefinder.cpp b/appl/refind/filefinder.cpp index 1b89746..996ee80 100644 --- a/appl/refind/filefinder.cpp +++ b/appl/refind/filefinder.cpp @@ -94,10 +94,13 @@ QString fileSize(int64_t size){ */ QString typeOf(QFileInfo& info){ QString rc; - if (info.isDir()) + if (info.isSymLink()){ + if (info.isDir()) + rc = QObject::tr("link (dir)"); + else + rc = QObject::tr("link (file)"); + } else if (info.isDir()) rc = QObject::tr("dir"); - else if (info.isSymLink()) - rc = QObject::tr("link"); else rc = QObject::tr("file"); return rc; @@ -111,13 +114,13 @@ QString typeOf(QFileInfo& info){ * @param table OUT: the table to fill */ void FileFinder::fillTable(const QString& path, int depth, QTableWidget* table){ - QDir dir(path); QFileInfoList entries; - if (m_patterns.count() > 0) - dir.setNameFilters(m_patterns); + QDir dir(path); QDir::Filters filters = m_fileTypes | QDir::NoDotAndDotDot; - dir.setFilter(filters); - dir.setFilter(m_fileTypes); + if (m_patterns.count() == 0) + entries = dir.entryInfoList(filters, QDir::NoSort); + else + entries = dir.entryInfoList(m_patterns, filters, QDir::NoSort); QList ::iterator it; QString relativePath = path.mid(1 + m_baseDir.length()); QString node, ext; @@ -152,7 +155,7 @@ void FileFinder::fillTable(const QString& path, int depth, QTableWidget* table){ m_lines++; } } - if (depth < m_maxDepth){ + if (depth < m_maxDepth || m_maxDepth < 0){ entries = dir.entryInfoList( QDir::NoSymLinks | QDir::NoDotAndDotDot | QDir::AllDirs, QDir::NoSort); bool filtered = m_excludedDirs.length() > 0; diff --git a/appl/refind/mainwindow.cpp b/appl/refind/mainwindow.cpp index 941cfb1..ddbf672 100644 --- a/appl/refind/mainwindow.cpp +++ b/appl/refind/mainwindow.cpp @@ -39,7 +39,7 @@ MainWindow::MainWindow(QWidget *parent) : ui->tableWidget->setColumnWidth(TC_EXT, 40); ui->tableWidget->setColumnWidth(TC_SIZE, 125); ui->tableWidget->setColumnWidth(TC_MODIFIED, 175); - ui->tableWidget->setColumnWidth(TC_TYPE, 50); + ui->tableWidget->setColumnWidth(TC_TYPE, 75); ui->tableWidget->horizontalHeader()->setStretchLastSection(true); } @@ -213,7 +213,7 @@ void MainWindow::search(){ void MainWindow::selectDirectory(){ QString dir = QFileDialog::getExistingDirectory(this, tr("Select Directory"), ui->comboBoxDirectory->currentText(), - QFileDialog::ShowDirsOnly| QFileDialog::DontResolveSymlinks); + QFileDialog::ShowDirsOnly); if (! dir.isEmpty()) ui->comboBoxDirectory->setCurrentText(dir); } diff --git a/appl/refind/mainwindow.ui b/appl/refind/mainwindow.ui index 7ef477f..213f712 100644 --- a/appl/refind/mainwindow.ui +++ b/appl/refind/mainwindow.ui @@ -6,12 +6,12 @@ 0 0 - 888 + 1030 579 - MainWindow + RePubLib File Finder @@ -57,7 +57,7 @@ - + 75 @@ -221,7 +221,7 @@ - <html><head/><body><p>a comma (',') separated list of filename patterns</p><p>Example: *.txt,*.odt</p></body></html> + <html><head/><body><p>A comma (',') separated list of filename patterns</p><p>Example: *.txt,*.odt</p></body></html> true @@ -285,6 +285,9 @@ + + Execute the search + Search @@ -310,7 +313,7 @@ - change to parent directory + Change to the parent directory ⇑ @@ -332,7 +335,7 @@ - select directory by a dialog box + Select directory by a dialog box ... @@ -343,6 +346,9 @@ + + The base directory (starting point of the search) + true @@ -362,7 +368,7 @@ - + Files @@ -422,6 +428,9 @@ 16777215 + + <html><head/><body><p>Formula of the minimal size.</p><p>Example: 3*512ki + 5MiByte + -2^10</p><p><br/></p><p>A non zero value excludes automatically directories.</p><p>A formula is a arithmetic expression with the operators '+', '*' and '^' (potentioning).</p><p>Usual precedence: '+' &lt; '*' &lt; '^'</p><p>The operands are integer numbers with potentionally a unit.</p><p>Units: factor 1000: KByte, MByte, GByte, TByte<br/>factor 1024: KiByte, MiByte, GiByte, TiByte</p><p><br/></p></body></html> + true @@ -454,6 +463,9 @@ 16777215 + + <html><head/><body><p>Formula of the minimal file date.</p><p>Example (relative): 3*5days+ 2hour</p><p>Example (absolute): 2015.12.31/23:59:59 - 3weeks</p><p><br/></p><p>A formula is a arithmetic expression with the operators '+', '*' and '^' (potentioning).</p><p>Usual precedence: '+' &lt; '*' &lt; '^'</p><p>The operands are integer numbers with potentionally a unit.</p><p>The first operand may be an absolute date, date and time or time:</p><p>Date syntax: yyyy.mm.dd</p><p>Time syntax HH:MM:SS</p><p>Units: minutes, hours, days, weeks</p><p>Abbrevation is allowed: 'd' is the same as 'days'</p><p><br/></p></body></html> + true @@ -468,6 +480,9 @@ + + <html><head/><body><p>Minimal distance of the subdirectory containing the found file from the base directory.</p><p>Example:<br/>Min.Depth: 1<br/>Direcory: /home</p><p>/home/x will not be found</p><p>/home/dir/x will be found</p></body></html> + true @@ -500,6 +515,9 @@ 16777215 + + <html><head/><body><p>Formula of the maximum size.</p><p>Example: 3*512ki + 5MiByte + -2^10</p><p><br/></p><p>A non zero value excludes automatically directories.</p><p>A formula is a arithmetic expression with the operators '+', '*' and '^' (potentioning).</p><p>Usual precedence: '+' &lt; '*' &lt; '^'</p><p>The operands are integer numbers with potentionally a unit.</p><p>Units: factor 1000: KByte, MByte, GByte, TByte<br/>factor 1024: KiByte, MiByte, GiByte, TiByte</p><p><br/></p></body></html> + true @@ -526,6 +544,9 @@ 16777215 + + <html><head/><body><p>Formula of the maximal file date.</p><p>Example (relative): 3*5days+ 2hour</p><p>Example (absolute): 2015.12.31/23:59:59 - 3weeks</p><p><br/></p><p>A formula is a arithmetic expression with the operators '+', '*' and '^' (potentioning).</p><p>Usual precedence: '+' &lt; '*' &lt; '^'</p><p>The operands are integer numbers with potentionally a unit.</p><p>The first operand may be an absolute date, date and time or time:</p><p>Date syntax: yyyy.mm.dd</p><p>Time syntax HH:MM:SS</p><p>Units: minutes, hours, days, weeks</p><p>Abbrevation is allowed: 'd' is the same as 'days'</p><p><br/></p></body></html> + true @@ -540,6 +561,9 @@ + + <html><head/><body><p>Maximum distance of the subdirectory containing the found file from the base directory.</p><p>Example:<br/>Max. Depth: 0<br/>It found no files in subdirectories.</p></body></html> + true @@ -555,7 +579,7 @@ - <html><head/><body><p>a comma (',') separated list of directory names not entered for the search</p><p>Example: .git,.cache</p></body></html> + <html><head/><body><p>a comma (',') separated list of directory names not entered for the search.</p><p>Example: .git,.cache</p></body></html> true @@ -594,7 +618,7 @@ Size (MByte) - AlignRight|AlignVCenter + AlignRight|AlignBottom @@ -626,7 +650,7 @@ 0 0 - 888 + 1030 23 @@ -710,8 +734,8 @@ pushButtonUp pushButtonDirectory comboBoxFilePatterns - checkBoxDirs checkBoxFiles + checkBoxDirs checkBoxLinks checkBoxHidden checkBoxWritable