*/
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;
* @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 <QFileInfo>::iterator it;
QString relativePath = path.mid(1 + m_baseDir.length());
QString node, ext;
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;
<rect>
<x>0</x>
<y>0</y>
- <width>888</width>
+ <width>1030</width>
<height>579</height>
</rect>
</property>
<property name="windowTitle">
- <string>MainWindow</string>
+ <string>RePubLib File Finder</string>
</property>
<widget class="QWidget" name="centralWidget">
<layout class="QVBoxLayout" name="verticalLayout_3">
<item row="2" column="5" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
- <widget class="QCheckBox" name="checkBoxFiles">
+ <widget class="QCheckBox" name="checkBoxDirs">
<property name="minimumSize">
<size>
<width>75</width>
<item row="2" column="1">
<widget class="QComboBox" name="comboBoxFilePatterns">
<property name="toolTip">
- <string><html><head/><body><p>a comma (',') separated list of filename patterns</p><p>Example: *.txt,*.odt</p></body></html></string>
+ <string><html><head/><body><p>A comma (',') separated list of filename patterns</p><p>Example: *.txt,*.odt</p></body></html></string>
</property>
<property name="editable">
<bool>true</bool>
</item>
<item row="0" column="6">
<widget class="QPushButton" name="pushButtonSearch">
+ <property name="toolTip">
+ <string>Execute the search</string>
+ </property>
<property name="text">
<string>Search</string>
</property>
</size>
</property>
<property name="toolTip">
- <string>change to parent directory</string>
+ <string>Change to the parent directory</string>
</property>
<property name="text">
<string>⇑</string>
</size>
</property>
<property name="toolTip">
- <string>select directory by a dialog box</string>
+ <string>Select directory by a dialog box</string>
</property>
<property name="text">
<string>...</string>
</item>
<item row="0" column="1" colspan="2">
<widget class="QComboBox" name="comboBoxDirectory">
+ <property name="toolTip">
+ <string>The base directory (starting point of the search)</string>
+ </property>
<property name="editable">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="2">
- <widget class="QCheckBox" name="checkBoxDirs">
+ <widget class="QCheckBox" name="checkBoxFiles">
<property name="text">
<string>Files</string>
</property>
<height>16777215</height>
</size>
</property>
+ <property name="toolTip">
+ <string><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></string>
+ </property>
<property name="editable">
<bool>true</bool>
</property>
<height>16777215</height>
</size>
</property>
+ <property name="toolTip">
+ <string><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></string>
+ </property>
<property name="editable">
<bool>true</bool>
</property>
</item>
<item row="0" column="5">
<widget class="QComboBox" name="comboBoxMinDepth">
+ <property name="toolTip">
+ <string><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></string>
+ </property>
<property name="editable">
<bool>true</bool>
</property>
<height>16777215</height>
</size>
</property>
+ <property name="toolTip">
+ <string><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></string>
+ </property>
<property name="editable">
<bool>true</bool>
</property>
<height>16777215</height>
</size>
</property>
+ <property name="toolTip">
+ <string><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></string>
+ </property>
<property name="editable">
<bool>true</bool>
</property>
</item>
<item row="1" column="5">
<widget class="QComboBox" name="comboBoxMaxDepth">
+ <property name="toolTip">
+ <string><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></string>
+ </property>
<property name="editable">
<bool>true</bool>
</property>
<item row="2" column="1" colspan="3">
<widget class="QComboBox" name="comboBoxExcludedDirs">
<property name="toolTip">
- <string><html><head/><body><p>a comma (',') separated list of directory names not entered for the search</p><p>Example: .git,.cache</p></body></html></string>
+ <string><html><head/><body><p>a comma (',') separated list of directory names not entered for the search.</p><p>Example: .git,.cache</p></body></html></string>
</property>
<property name="editable">
<bool>true</bool>
<string>Size (MByte)</string>
</property>
<property name="textAlignment">
- <set>AlignRight|AlignVCenter</set>
+ <set>AlignRight|AlignBottom</set>
</property>
</column>
<column>
<rect>
<x>0</x>
<y>0</y>
- <width>888</width>
+ <width>1030</width>
<height>23</height>
</rect>
</property>
<tabstop>pushButtonUp</tabstop>
<tabstop>pushButtonDirectory</tabstop>
<tabstop>comboBoxFilePatterns</tabstop>
- <tabstop>checkBoxDirs</tabstop>
<tabstop>checkBoxFiles</tabstop>
+ <tabstop>checkBoxDirs</tabstop>
<tabstop>checkBoxLinks</tabstop>
<tabstop>checkBoxHidden</tabstop>
<tabstop>checkBoxWritable</tabstop>