Moved scanWorkspace to Repository
FossilOrigin-Name: 61734cf430e041d514222c71f751feead5b7faf6
This commit is contained in:
parent
97f210fd46
commit
d289dee92b
14
manifest
14
manifest
@ -1,5 +1,5 @@
|
|||||||
C Added\sUICallback::updateProcess\nMoved\sscanDirectory\sto\sRepository
|
C Moved\sscanWorkspace\sto\sRepository
|
||||||
D 2015-04-30T09:50:22.918
|
D 2015-04-30T10:30:47.754
|
||||||
F .travis.yml 77966888a81c4ceee1fcc79bce842c9667ad8a35
|
F .travis.yml 77966888a81c4ceee1fcc79bce842c9667ad8a35
|
||||||
F debian/changelog eb4304dfcb6bb66850ec740838090eb50ce1249b
|
F debian/changelog eb4304dfcb6bb66850ec740838090eb50ce1249b
|
||||||
F debian/compat b6abd567fa79cbe0196d093a067271361dc6ca8b
|
F debian/compat b6abd567fa79cbe0196d093a067271361dc6ca8b
|
||||||
@ -200,8 +200,8 @@ F src/FileTableView.cpp 5ddf8c391c9a3ac449ec61fb1db837b577afeec2
|
|||||||
F src/FileTableView.h 03e56d87c2d46411b9762b87f4d301619aaf18df
|
F src/FileTableView.h 03e56d87c2d46411b9762b87f4d301619aaf18df
|
||||||
F src/LoggedProcess.cpp 2a1e5c94bc1e57c8984563e66c210e43a14dc60c
|
F src/LoggedProcess.cpp 2a1e5c94bc1e57c8984563e66c210e43a14dc60c
|
||||||
F src/LoggedProcess.h 85df7c635c807a5a0e8c4763f17a0752aaff7261
|
F src/LoggedProcess.h 85df7c635c807a5a0e8c4763f17a0752aaff7261
|
||||||
F src/MainWindow.cpp d0592f736ae782633c9d2dd510ab5f0d5c80fabf
|
F src/MainWindow.cpp 939c919b6ede21771df77ff9973da7b3e39808dc
|
||||||
F src/MainWindow.h f9470bc231db5fc95661254c0bab2854adfd3ffb
|
F src/MainWindow.h 49f8f8241f54e99101828de6501bd77780510c4c
|
||||||
F src/SettingsDialog.cpp a46cff5e5dd425e3dbdd15632abfd5829f5562b4
|
F src/SettingsDialog.cpp a46cff5e5dd425e3dbdd15632abfd5829f5562b4
|
||||||
F src/SettingsDialog.h 4e2790f581e991c744ae9f86580f1972b8c7ff43
|
F src/SettingsDialog.h 4e2790f581e991c744ae9f86580f1972b8c7ff43
|
||||||
F src/Utils.cpp f78728e0817b1db23007ba0d2c5c26980ee7ebca
|
F src/Utils.cpp f78728e0817b1db23007ba0d2c5c26980ee7ebca
|
||||||
@ -215,7 +215,7 @@ F ui/CommitDialog.ui 6200f6cabdcf40a20812e811be28e0793f82516f
|
|||||||
F ui/FileActionDialog.ui 89bb4dc2d0b8adcd41adcb11ec65f2028a09a12d
|
F ui/FileActionDialog.ui 89bb4dc2d0b8adcd41adcb11ec65f2028a09a12d
|
||||||
F ui/MainWindow.ui 8677f5c8bca5bf7561d5f64bfdd0cef5157c6ac7
|
F ui/MainWindow.ui 8677f5c8bca5bf7561d5f64bfdd0cef5157c6ac7
|
||||||
F ui/SettingsDialog.ui 2b7c2870e0054b0f4106f495d85d02c0b814df8b
|
F ui/SettingsDialog.ui 2b7c2870e0054b0f4106f495d85d02c0b814df8b
|
||||||
P c48861c93293aafa6b1193a4b6892342e0ca0159
|
P 4d94a638499c31672bf47de43407b1fa2531e716
|
||||||
R 49f72f8f9eafff06a5ea35eb0497e88d
|
R 9c35dcfb53087265b1dc9de40e3abf6c
|
||||||
U kostas
|
U kostas
|
||||||
Z 025a79c928231b5b6d280e6959bd1db5
|
Z ba97d0832e88bf4227c1c8c175541671
|
||||||
|
@ -1 +1 @@
|
|||||||
4d94a638499c31672bf47de43407b1fa2531e716
|
61734cf430e041d514222c71f751feead5b7faf6
|
@ -584,11 +584,11 @@ bool MainWindow::refresh()
|
|||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
void MainWindow::scanWorkspace()
|
void Repository::scanWorkspace(bool scanLocal, bool scanIgnored, bool scanModified, bool scanUnchanged, const QString &ignoreGlob, Bridge::UICallback &uiCallback, bool &operationAborted)
|
||||||
{
|
{
|
||||||
// Scan all workspace files
|
// Scan all workspace files
|
||||||
QFileInfoList all_files;
|
QFileInfoList all_files;
|
||||||
QString wkdir = getCurrentWorkspace();
|
QString wkdir = fossil().getCurrentWorkspace();
|
||||||
|
|
||||||
if(wkdir.isEmpty())
|
if(wkdir.isEmpty())
|
||||||
return;
|
return;
|
||||||
@ -598,33 +598,32 @@ void MainWindow::scanWorkspace()
|
|||||||
if(!fossil().listFiles(res))
|
if(!fossil().listFiles(res))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
bool scan_files = ui->actionViewUnknown->isChecked();
|
bool scan_files = scanLocal;
|
||||||
|
|
||||||
setStatus(tr("Scanning Workspace..."));
|
|
||||||
setBusy(true);
|
|
||||||
|
|
||||||
// Dispose RepoFiles
|
// Dispose RepoFiles
|
||||||
for(Repository::filemap_t::iterator it = getRepo().workspaceFiles.begin(); it!=getRepo().workspaceFiles.end(); ++it)
|
for(Repository::filemap_t::iterator it = workspaceFiles.begin(); it!=workspaceFiles.end(); ++it)
|
||||||
delete *it;
|
delete *it;
|
||||||
|
|
||||||
getRepo().workspaceFiles.clear();
|
workspaceFiles.clear();
|
||||||
getRepo().pathSet.clear();
|
pathSet.clear();
|
||||||
|
|
||||||
operationAborted = false;
|
operationAborted = false;
|
||||||
|
|
||||||
|
uiCallback.beginProcess("");
|
||||||
if(scan_files)
|
if(scan_files)
|
||||||
{
|
{
|
||||||
QCoreApplication::processEvents();
|
QCoreApplication::processEvents();
|
||||||
|
|
||||||
QString ignore;
|
QString ignore;
|
||||||
// If we should not be showing ignored files, fill in the ignored spec
|
// If we should not be showing ignored files, fill in the ignored spec
|
||||||
if(!ui->actionViewIgnored->isChecked())
|
if(!scanIgnored)
|
||||||
{
|
{
|
||||||
// QDir expects multiple specs being separated by a semicolon
|
// QDir expects multiple specs being separated by a semicolon
|
||||||
ignore = settings.GetFossilValue(FOSSIL_SETTING_IGNORE_GLOB).toString().replace(',',';');
|
ignore = ignoreGlob;
|
||||||
|
ignore.replace(',',';');
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!getRepo().scanDirectory(all_files, wkdir, wkdir, ignore, operationAborted, uiCallback))
|
if(!scanDirectory(all_files, wkdir, wkdir, ignore, operationAborted, uiCallback))
|
||||||
goto _done;
|
goto _done;
|
||||||
|
|
||||||
for(QFileInfoList::iterator it=all_files.begin(); it!=all_files.end(); ++it)
|
for(QFileInfoList::iterator it=all_files.begin(); it!=all_files.end(); ++it)
|
||||||
@ -637,13 +636,13 @@ void MainWindow::scanWorkspace()
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
RepoFile *rf = new RepoFile(*it, RepoFile::TYPE_UNKNOWN, wkdir);
|
RepoFile *rf = new RepoFile(*it, RepoFile::TYPE_UNKNOWN, wkdir);
|
||||||
getRepo().workspaceFiles.insert(rf->getFilePath(), rf);
|
workspaceFiles.insert(rf->getFilePath(), rf);
|
||||||
getRepo().pathSet.insert(rf->getPath());
|
pathSet.insert(rf->getPath());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
uiCallback.endProcess();
|
||||||
|
|
||||||
setStatus(tr("Updating..."));
|
uiCallback.beginProcess(QObject::tr("Updating..."));
|
||||||
QCoreApplication::processEvents();
|
|
||||||
|
|
||||||
// Update Files and Directories
|
// Update Files and Directories
|
||||||
|
|
||||||
@ -683,43 +682,56 @@ void MainWindow::scanWorkspace()
|
|||||||
type = RepoFile::TYPE_CONFLICTED;
|
type = RepoFile::TYPE_CONFLICTED;
|
||||||
|
|
||||||
// Filter unwanted file types
|
// Filter unwanted file types
|
||||||
if( ((type & RepoFile::TYPE_MODIFIED) && !ui->actionViewModified->isChecked()) ||
|
if( ((type & RepoFile::TYPE_MODIFIED) && !scanModified) ||
|
||||||
((type & RepoFile::TYPE_UNCHANGED) && !ui->actionViewUnchanged->isChecked() ))
|
((type & RepoFile::TYPE_UNCHANGED) && !scanUnchanged))
|
||||||
{
|
{
|
||||||
getRepo().workspaceFiles.remove(fname);
|
workspaceFiles.remove(fname);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
add_missing = true;
|
add_missing = true;
|
||||||
|
|
||||||
Repository::filemap_t::iterator it = getRepo().workspaceFiles.find(fname);
|
Repository::filemap_t::iterator it = workspaceFiles.find(fname);
|
||||||
|
|
||||||
RepoFile *rf = 0;
|
RepoFile *rf = 0;
|
||||||
if(add_missing && it==getRepo().workspaceFiles.end())
|
if(add_missing && it==workspaceFiles.end())
|
||||||
{
|
{
|
||||||
QFileInfo info(wkdir+QDir::separator()+fname);
|
QFileInfo info(wkdir+QDir::separator()+fname);
|
||||||
rf = new RepoFile(info, type, wkdir);
|
rf = new RepoFile(info, type, wkdir);
|
||||||
getRepo().workspaceFiles.insert(rf->getFilePath(), rf);
|
workspaceFiles.insert(rf->getFilePath(), rf);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!rf)
|
if(!rf)
|
||||||
{
|
{
|
||||||
it = getRepo().workspaceFiles.find(fname);
|
it = workspaceFiles.find(fname);
|
||||||
Q_ASSERT(it!=getRepo().workspaceFiles.end());
|
Q_ASSERT(it!=workspaceFiles.end());
|
||||||
rf = *it;
|
rf = *it;
|
||||||
}
|
}
|
||||||
|
|
||||||
rf->setType(type);
|
rf->setType(type);
|
||||||
|
|
||||||
QString path = rf->getPath();
|
QString path = rf->getPath();
|
||||||
getRepo().pathSet.insert(path);
|
pathSet.insert(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load the stash
|
// Load the stash
|
||||||
fossil().stashList(getRepo().stashMap);
|
fossil().stashList(stashMap);
|
||||||
|
|
||||||
// Update the file item model
|
|
||||||
_done:
|
_done:
|
||||||
|
uiCallback.endProcess();
|
||||||
|
}
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
void MainWindow::scanWorkspace()
|
||||||
|
{
|
||||||
|
setBusy(true);
|
||||||
|
getRepo().scanWorkspace(ui->actionViewUnknown->isChecked(),
|
||||||
|
ui->actionViewIgnored->isChecked(),
|
||||||
|
ui->actionViewModified->isChecked(),
|
||||||
|
ui->actionViewUnchanged->isChecked(),
|
||||||
|
settings.GetFossilValue(FOSSIL_SETTING_IGNORE_GLOB).toString(),
|
||||||
|
uiCallback,
|
||||||
|
operationAborted
|
||||||
|
);
|
||||||
updateDirView();
|
updateDirView();
|
||||||
updateFileView();
|
updateFileView();
|
||||||
updateStashView();
|
updateStashView();
|
||||||
@ -2183,6 +2195,7 @@ void MainWindow::MainWinUICallback::beginProcess(const QString& text)
|
|||||||
Q_ASSERT(mainWindow);
|
Q_ASSERT(mainWindow);
|
||||||
mainWindow->ui->statusBar->showMessage(text);
|
mainWindow->ui->statusBar->showMessage(text);
|
||||||
mainWindow->progressBar->setHidden(false);
|
mainWindow->progressBar->setHidden(false);
|
||||||
|
QCoreApplication::processEvents();
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
@ -2199,6 +2212,7 @@ void MainWindow::MainWinUICallback::endProcess()
|
|||||||
Q_ASSERT(mainWindow);
|
Q_ASSERT(mainWindow);
|
||||||
mainWindow->ui->statusBar->clearMessage();
|
mainWindow->ui->statusBar->clearMessage();
|
||||||
mainWindow->progressBar->setHidden(true);
|
mainWindow->progressBar->setHidden(true);
|
||||||
|
QCoreApplication::processEvents();
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
@ -124,7 +124,12 @@ public:
|
|||||||
stashmap_t stashMap;
|
stashmap_t stashMap;
|
||||||
stringset_t selectedDirs; // The directory selected in the tree
|
stringset_t selectedDirs; // The directory selected in the tree
|
||||||
|
|
||||||
|
Bridge bridge;
|
||||||
|
Bridge & fossil() { return bridge; }
|
||||||
|
const Bridge & fossil() const { return bridge; }
|
||||||
|
|
||||||
static bool scanDirectory(QFileInfoList &entries, const QString& dirPath, const QString &baseDir, const QString ignoreSpec, const bool& abort, Bridge::UICallback &uiCallback);
|
static bool scanDirectory(QFileInfoList &entries, const QString& dirPath, const QString &baseDir, const QString ignoreSpec, const bool& abort, Bridge::UICallback &uiCallback);
|
||||||
|
void scanWorkspace(bool scanLocal, bool scanIgnored, bool scanModified, bool scanUnchanged, const QString &ignoreGlob, Bridge::UICallback &uiCallback, bool &operationAborted);
|
||||||
};
|
};
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
@ -165,7 +170,6 @@ private:
|
|||||||
void loadFossilSettings();
|
void loadFossilSettings();
|
||||||
QString getFossilPath();
|
QString getFossilPath();
|
||||||
QString getFossilHttpAddress();
|
QString getFossilHttpAddress();
|
||||||
//static bool scanDirectory(QFileInfoList &entries, const QString& dirPath, const QString &baseDir, const QString ignoreSpec, const bool& abort);
|
|
||||||
void updateDirView();
|
void updateDirView();
|
||||||
void updateFileView();
|
void updateFileView();
|
||||||
void updateStashView();
|
void updateStashView();
|
||||||
@ -268,13 +272,12 @@ private:
|
|||||||
class QShortcut *abortShortcut;
|
class QShortcut *abortShortcut;
|
||||||
bool operationAborted;
|
bool operationAborted;
|
||||||
|
|
||||||
Bridge bridge;
|
|
||||||
Bridge & fossil() { return bridge; }
|
|
||||||
const Bridge & fossil() const { return bridge; }
|
|
||||||
|
|
||||||
Repository repo;
|
Repository repo;
|
||||||
Repository & getRepo() { return repo; }
|
Repository & getRepo() { return repo; }
|
||||||
|
|
||||||
|
Bridge & fossil() { return repo.bridge; }
|
||||||
|
const Bridge & fossil() const { return repo.bridge; }
|
||||||
|
|
||||||
Settings &settings;
|
Settings &settings;
|
||||||
QStringList workspaceHistory;
|
QStringList workspaceHistory;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user