Added support for filtering files based on repository status
FossilOrigin-Name: 63e7632f4e844c0915cb4ae6cce07ee173e7926b
This commit is contained in:
parent
9a1a137539
commit
98903bf056
@ -374,26 +374,33 @@ void MainWindow::scanWorkspace()
|
||||
QFileInfoList all_files;
|
||||
QString wkdir = getCurrentWorkspace();
|
||||
|
||||
RecurseDirectory(all_files, wkdir, wkdir);
|
||||
workspaceFiles.clear();
|
||||
for(QFileInfoList::iterator it=all_files.begin(); it!=all_files.end(); ++it)
|
||||
{
|
||||
QString filename = it->fileName();
|
||||
|
||||
// Skip fossil files
|
||||
if(filename == "_FOSSIL_" || (!repositoryFile.isEmpty() && it->absoluteFilePath()==repositoryFile))
|
||||
continue;
|
||||
|
||||
RepoFile e;
|
||||
e.set(*it, RepoFile::TYPE_UNKNOWN, wkdir);
|
||||
workspaceFiles.insert(e.getFilename(), e);
|
||||
}
|
||||
|
||||
// Retrieve the status of files tracked by fossil
|
||||
QStringList res;
|
||||
if(!runFossil(QStringList() << "ls" << "-l", &res, SILENT_STATUS))
|
||||
return;
|
||||
|
||||
bool scan_files = ui->actionViewUnknown->isChecked();
|
||||
|
||||
workspaceFiles.clear();
|
||||
if(scan_files)
|
||||
{
|
||||
RecurseDirectory(all_files, wkdir, wkdir);
|
||||
|
||||
for(QFileInfoList::iterator it=all_files.begin(); it!=all_files.end(); ++it)
|
||||
{
|
||||
QString filename = it->fileName();
|
||||
|
||||
// Skip fossil files
|
||||
if(filename == "_FOSSIL_" || (!repositoryFile.isEmpty() && it->absoluteFilePath()==repositoryFile))
|
||||
continue;
|
||||
|
||||
RepoFile e;
|
||||
e.set(*it, RepoFile::TYPE_UNKNOWN, wkdir);
|
||||
workspaceFiles.insert(e.getFilename(), e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for(QStringList::iterator it=res.begin(); it!=res.end(); ++it)
|
||||
{
|
||||
QString line = (*it).trimmed();
|
||||
@ -404,7 +411,9 @@ void MainWindow::scanWorkspace()
|
||||
QString fname = line.right(line.length() - 10).trimmed();
|
||||
RepoFile::EntryType type = RepoFile::TYPE_UNKNOWN;
|
||||
|
||||
bool add_missing = false;
|
||||
// Generate a RepoFile for all non-existant fossil files
|
||||
// or for all files if we skipped scanning the workspace
|
||||
bool add_missing = !scan_files;
|
||||
|
||||
if(status_text=="EDITED")
|
||||
type = RepoFile::TYPE_EDITTED;
|
||||
@ -425,6 +434,14 @@ void MainWindow::scanWorkspace()
|
||||
else if(status_text=="UNCHANGED")
|
||||
type = RepoFile::TYPE_UNCHANGED;
|
||||
|
||||
// Filter unwanted file types
|
||||
if( ((type & RepoFile::TYPE_MODIFIED) && !ui->actionViewModified->isChecked()) ||
|
||||
((type & RepoFile::TYPE_UNCHANGED) && !ui->actionViewUnchanged->isChecked() ))
|
||||
{
|
||||
workspaceFiles.remove(fname);
|
||||
continue;
|
||||
}
|
||||
|
||||
filemap_t::iterator it = workspaceFiles.find(fname);
|
||||
|
||||
if(add_missing && it==workspaceFiles.end())
|
||||
@ -785,6 +802,14 @@ void MainWindow::loadSettings()
|
||||
_size.setHeight(qsettings.value("WindowHeight").toInt());
|
||||
resize(_size);
|
||||
}
|
||||
|
||||
if(qsettings.contains("ViewUnknown"))
|
||||
ui->actionViewUnknown->setChecked(qsettings.value("ViewUnknown").toBool());
|
||||
if(qsettings.contains("ViewModified"))
|
||||
ui->actionViewModified->setChecked(qsettings.value("ViewModified").toBool());
|
||||
if(qsettings.contains("ViewUnchanged"))
|
||||
ui->actionViewUnchanged->setChecked(qsettings.value("ViewUnchanged").toBool());
|
||||
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@ -812,7 +837,9 @@ void MainWindow::saveSettings()
|
||||
qsettings.setValue("WindowY", y());
|
||||
qsettings.setValue("WindowWidth", width());
|
||||
qsettings.setValue("WindowHeight", height());
|
||||
|
||||
qsettings.setValue("ViewUnknown", ui->actionViewUnknown->isChecked());
|
||||
qsettings.setValue("ViewModified", ui->actionViewModified->isChecked());
|
||||
qsettings.setValue("ViewUnchanged", ui->actionViewUnchanged->isChecked());
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@ -974,7 +1001,7 @@ void MainWindow::on_actionPull_triggered()
|
||||
void MainWindow::on_actionCommit_triggered()
|
||||
{
|
||||
QStringList modified_files;
|
||||
getSelectionFilenames(modified_files, RepoFile::TYPE_REPO_MODIFIED, true);
|
||||
getSelectionFilenames(modified_files, RepoFile::TYPE_MODIFIED, true);
|
||||
|
||||
if(modified_files.empty())
|
||||
return;
|
||||
@ -1334,3 +1361,21 @@ void MainWindow::on_actionSyncSettings_triggered()
|
||||
runFossil(QStringList() << "remote-url" << QuotePath(url.toString()), 0, true);
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
void MainWindow::on_actionViewModified_triggered()
|
||||
{
|
||||
refresh();
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
void MainWindow::on_actionViewUnchanged_triggered()
|
||||
{
|
||||
refresh();
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
void MainWindow::on_actionViewUnknown_triggered()
|
||||
{
|
||||
refresh();
|
||||
}
|
||||
|
@ -27,8 +27,8 @@ struct RepoFile
|
||||
TYPE_DELETED = 1<<4,
|
||||
TYPE_MISSING = 1<<5,
|
||||
TYPE_RENAMED = 1<<6,
|
||||
TYPE_REPO_MODIFIED = TYPE_EDITTED|TYPE_ADDED|TYPE_DELETED|TYPE_MISSING|TYPE_RENAMED,
|
||||
TYPE_REPO = TYPE_UNCHANGED|TYPE_REPO_MODIFIED,
|
||||
TYPE_MODIFIED = TYPE_EDITTED|TYPE_ADDED|TYPE_DELETED|TYPE_MISSING|TYPE_RENAMED,
|
||||
TYPE_REPO = TYPE_UNCHANGED|TYPE_MODIFIED,
|
||||
TYPE_ALL = TYPE_UNKNOWN|TYPE_REPO
|
||||
};
|
||||
|
||||
@ -158,6 +158,9 @@ private slots:
|
||||
void on_actionUpdate_triggered();
|
||||
void on_actionSettings_triggered();
|
||||
void on_actionSyncSettings_triggered();
|
||||
void on_actionViewUnchanged_triggered();
|
||||
void on_actionViewModified_triggered();
|
||||
void on_actionViewUnknown_triggered();
|
||||
|
||||
private:
|
||||
enum
|
||||
|
@ -109,7 +109,16 @@
|
||||
</property>
|
||||
<addaction name="actionAbout"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menuView">
|
||||
<property name="title">
|
||||
<string>View</string>
|
||||
</property>
|
||||
<addaction name="actionViewModified"/>
|
||||
<addaction name="actionViewUnchanged"/>
|
||||
<addaction name="actionViewUnknown"/>
|
||||
</widget>
|
||||
<addaction name="menuFile"/>
|
||||
<addaction name="menuView"/>
|
||||
<addaction name="menuHelp"/>
|
||||
</widget>
|
||||
<widget class="QToolBar" name="mainToolBar">
|
||||
@ -455,6 +464,39 @@
|
||||
<string>Set remote synchronization settings</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionViewModified">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Modified</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionViewUnchanged">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Unchanged</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionViewUnknown">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Unknown</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<layoutdefault spacing="6" margin="11"/>
|
||||
<resources>
|
||||
|
16
manifest
16
manifest
@ -1,14 +1,14 @@
|
||||
C Remove\sinvalid\sworkspaces\sstored\sin\sthe\ssettings
|
||||
D 2011-08-29T14:43:46.790
|
||||
C Added\ssupport\sfor\sfiltering\sfiles\sbased\son\srepository\sstatus
|
||||
D 2011-08-29T15:33:36.209
|
||||
F CommitDialog.cpp a1fcdc94933f4e1a144224c7c70f1e067d3ee31e
|
||||
F CommitDialog.h 0550b1b652924ae54b6f6c9274cad2d4c491808a
|
||||
F CommitDialog.ui 5067623f6af6f5a42c87df903278e383e945e154
|
||||
F FileActionDialog.cpp fcaebf9986f789b3440d5390b3458ad5f86fe0c8
|
||||
F FileActionDialog.h 15db1650b3a13d70bc338371e4c033c66e3b79ce
|
||||
F FileActionDialog.ui c63644428579741aeb5fa052e237ba799ced9ad7
|
||||
F MainWindow.cpp 93472d3e2f24070ac4738927cc3e55e865ece6c9
|
||||
F MainWindow.h 104f575b6fffe43880849c9ce8c8b986292e4d6c
|
||||
F MainWindow.ui 2f08596fe34f5496af90f6d355d4de857e77ad8a
|
||||
F MainWindow.cpp 99bc7ba0623dd6c651006edc8ff91256d7e1f8b3
|
||||
F MainWindow.h 21fbbabd8b827d0b49fe3d40763b71042205fc3d
|
||||
F MainWindow.ui 5d10c04ab0f19f9b38a4da0abb0b36a00ff12efc
|
||||
F RepoDialog.cpp 8f20e1511526973555c774350ec413dcecf51c9e
|
||||
F RepoDialog.h a958c5f98f1e6882bf41dbdd2e4df3cb89700802
|
||||
F RepoDialog.ui be7b18199c04a3003f3c7534a616cd7441b7bb0c
|
||||
@ -173,7 +173,7 @@ F icons/fuel.icns 81e535004b62db801a02f3e15d0a33afc9d4070b
|
||||
F icons/fuel.ico eb529ab3332a17b9302ef3e851db5b9ebce2a038
|
||||
F main.cpp 083845039c167badd57a4abf482dd3d5e77aab35
|
||||
F resources.qrc e98383ed205f4e37100c60057e0129c3b86dea53
|
||||
P f00132a6072016db6840e2059bc8d332e760ecdb
|
||||
R cfe9e1ab63d013dd1b81a63a9d466db8
|
||||
P aa301610ecdf98433193c01c5ab7dfe32daf7227
|
||||
R 0ee9d30b0bebbccc0cc2d50826a5dbb5
|
||||
U kostas
|
||||
Z 5c2c25a81b23778f84b13b0b6bda4982
|
||||
Z 1621170487fad36927e9b07f1f884622
|
||||
|
@ -1 +1 @@
|
||||
aa301610ecdf98433193c01c5ab7dfe32daf7227
|
||||
63e7632f4e844c0915cb4ae6cce07ee173e7926b
|
Loading…
x
Reference in New Issue
Block a user