}
if (ignore)
continue;
- if (isInterruptionRequested())
+ if (m_stop)
break;
if (depth >= m_minDepth && isValid(*it)){
bool isDir = it->isDir();
for (it2 = antiPatterns.begin(); it2 != antiPatterns.end(); ++it2){
delete *it2;
}
- if (! isInterruptionRequested()
- && (depth < m_maxDepth || m_maxDepth < 0) && m_maxHits > 0){
+ if (! m_stop && (depth < m_maxDepth || m_maxDepth < 0) && m_maxHits > 0){
entries = dir.entryInfoList(
QDir::NoSymLinks | QDir::NoDotAndDotDot | QDir::AllDirs, QDir::NoSort);
bool filtered = m_excludedDirs.length() > 0;
*/
void FileFinder::search(){
clock_t start = clock();
+ setStop(false);
m_statistics.clear();
QString path = ReFileUtils::nativePath(m_baseDir);
path = ReQStringUtils::chomp(path, OS_SEPARATOR);
}
return rc;
}
+/**
+ * Sets the stop flag.
+ *
+ * @param stop <code>true</code>: the file search must be stopped
+ */
+void FileFinder::setStop(bool stop)
+{
+ m_stop = stop;
+}
+
/**
* Sets the maximal hit count.
ui->comboBoxDirectory->setCurrentText(QDir::currentPath());
ui->tableWidget->setMainWindow(this);
statusBar()->addWidget(m_statusMessage);
- connect(ui->actionSearch, SIGNAL(triggered()), this, SLOT(search()));
+ connect(ui->actionStart, SIGNAL(triggered()), this, SLOT(search()));
connect(ui->actionClear, SIGNAL(triggered()), this, SLOT(clear()));
connect(ui->actionStop, SIGNAL(triggered()), this, SLOT(stop()));
connect(ui->pushButtonSearch, SIGNAL(clicked()), this, SLOT(search()));
connect(ui->pushButtonSearch2, SIGNAL(clicked()), this, SLOT(search()));
+ connect(ui->pushButtonStop, SIGNAL(clicked()), this, SLOT(stop()));
+ connect(ui->pushButtonStop2, SIGNAL(clicked()), this, SLOT(stop()));
connect(ui->pushButtonClear, SIGNAL(clicked()), this, SLOT(clear()));
connect(ui->actionUp, SIGNAL(triggered()), this, SLOT(up()));
connect(ui->pushButtonUp, SIGNAL(clicked()), this, SLOT(up()));
connect(ui->actionGetFullName, SIGNAL(triggered()), this,
SLOT(fullNameToClipboard()));
connect(ui->actionReset, SIGNAL(triggered()), this, SLOT(resetParameters()));
- connect(ui->tableWidget, SIGNAL(cellClicked(int,int)), this, SLOT(cellEntered(int, int)));
connect(ui->actionExport, SIGNAL(triggered()), this, SLOT(exportFiles()));
connect(ui->pushButtonExport, SIGNAL(clicked()), this, SLOT(exportFiles()));
connect(ui->pushButtonExportFile, SIGNAL(clicked()), this,
* @param start <code>true</code>: the search should start
*/
void MainWindow::startStop(bool start){
- ui->actionSearch->setEnabled(!start);
+ ui->actionStart->setEnabled(!start);
ui->actionStop->setEnabled(start);
ui->pushButtonSearch->setEnabled(! start);
ui->pushButtonSearch2->setEnabled(! start);
* Handles the "search" button.
*/
void MainWindow::stop(){
- m_finder->requestInterruption();
+ m_finder->setStop(true);
startStop(false);
}
<string>Size (MByte)</string>
</property>
<property name="textAlignment">
- <set>AlignTrailing|AlignBottom</set>
+ <set>AlignRight|AlignBottom</set>
</property>
</column>
<column>
<property name="title">
<string>&File</string>
</property>
- <addaction name="actionSearch"/>
- <addaction name="separator"/>
<addaction name="actionPreview"/>
<addaction name="actionExport"/>
<addaction name="separator"/>
<addaction name="actionStop"/>
</widget>
<addaction name="menuFile"/>
- <addaction name="menuSearch"/>
<addaction name="menu_Edit"/>
+ <addaction name="menuSearch"/>
<addaction name="menuNavigation"/>
<addaction name="menuHelp"/>
</widget>
<attribute name="toolBarBreak">
<bool>false</bool>
</attribute>
- <addaction name="actionSearch"/>
+ <addaction name="actionStart"/>
+ <addaction name="actionStop"/>
</widget>
<widget class="QStatusBar" name="statusBar"/>
<widget class="QToolBar" name="toolBarNavigate">