Renamed DirModel to TreeModel
FossilOrigin-Name: b49ff56d2af6aca465d8b2ce3b5a9455341e7a1c
This commit is contained in:
parent
9769de2674
commit
cee4c93efc
14
manifest
14
manifest
@ -1,5 +1,5 @@
|
|||||||
C Fixed\smissing\sworkspace\sview\sheader\swhen\srepository\sa\sis\snot\savailable
|
C Renamed\sDirModel\sto\sTreeModel
|
||||||
D 2015-05-17T10:08:19.918
|
D 2015-05-17T10:13:46.499
|
||||||
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,7 +200,7 @@ F src/Fossil.cpp ca7ad24622e1fc1a03c92d7ae9b51afc17f7c09c
|
|||||||
F src/Fossil.h d65a7461d213bcc30f08724d3306c6ee00843217
|
F src/Fossil.h d65a7461d213bcc30f08724d3306c6ee00843217
|
||||||
F src/LoggedProcess.cpp 2a1e5c94bc1e57c8984563e66c210e43a14dc60c
|
F src/LoggedProcess.cpp 2a1e5c94bc1e57c8984563e66c210e43a14dc60c
|
||||||
F src/LoggedProcess.h 85df7c635c807a5a0e8c4763f17a0752aaff7261
|
F src/LoggedProcess.h 85df7c635c807a5a0e8c4763f17a0752aaff7261
|
||||||
F src/MainWindow.cpp 0c0a9edf7a891b2af9c87c17ebcd4dbfa56a8be5
|
F src/MainWindow.cpp ec6143d24b4a0be026fb46ed65cf02ee04086417
|
||||||
F src/MainWindow.h 7a2ac41cdd205acccd64a5314f25621ecb616288
|
F src/MainWindow.h 7a2ac41cdd205acccd64a5314f25621ecb616288
|
||||||
F src/RevisionDialog.cpp 51065c65a07c118dd1a7363da4a55a135d1c6c9c
|
F src/RevisionDialog.cpp 51065c65a07c118dd1a7363da4a55a135d1c6c9c
|
||||||
F src/RevisionDialog.h b718c3009342eaabad39c8a11a253a4e4fef7a73
|
F src/RevisionDialog.h b718c3009342eaabad39c8a11a253a4e4fef7a73
|
||||||
@ -211,7 +211,7 @@ F src/SettingsDialog.h 4e2790f581e991c744ae9f86580f1972b8c7ff43
|
|||||||
F src/Utils.cpp 748a58f19187aff7f3b867894129291cbe091678
|
F src/Utils.cpp 748a58f19187aff7f3b867894129291cbe091678
|
||||||
F src/Utils.h 9cc125f59b8d46ff47bbde4c2cf9bc77f8e2553b
|
F src/Utils.h 9cc125f59b8d46ff47bbde4c2cf9bc77f8e2553b
|
||||||
F src/Workspace.cpp f68a4ca05d1b7c5c345fbd89527691813593c663
|
F src/Workspace.cpp f68a4ca05d1b7c5c345fbd89527691813593c663
|
||||||
F src/Workspace.h e13d21c15f27c2b36368a06f4316f261ff782814
|
F src/Workspace.h d6649a3ae1cd0fbad55237030313e85530417271
|
||||||
F src/main.cpp d8c65ea5e54102e4989fef9fd8cfd4f13ef8a8f0
|
F src/main.cpp d8c65ea5e54102e4989fef9fd8cfd4f13ef8a8f0
|
||||||
F tools/git-push.sh 62cc58434cae5b7bcd6bd9d4cce8b08739f31cd7 x
|
F tools/git-push.sh 62cc58434cae5b7bcd6bd9d4cce8b08739f31cd7 x
|
||||||
F tools/pack.sh d7f38a498c4e9327fecd6a6e5ac27be270d43008 x
|
F tools/pack.sh d7f38a498c4e9327fecd6a6e5ac27be270d43008 x
|
||||||
@ -222,7 +222,7 @@ F ui/FileActionDialog.ui 89bb4dc2d0b8adcd41adcb11ec65f2028a09a12d
|
|||||||
F ui/MainWindow.ui 9dd0f9ef3f486413c9af912ac557c0e7bf9c6f50
|
F ui/MainWindow.ui 9dd0f9ef3f486413c9af912ac557c0e7bf9c6f50
|
||||||
F ui/RevisionDialog.ui 27c3b98c665fec014a50cbf3352c0627f75e68cd
|
F ui/RevisionDialog.ui 27c3b98c665fec014a50cbf3352c0627f75e68cd
|
||||||
F ui/SettingsDialog.ui 2b7c2870e0054b0f4106f495d85d02c0b814df8b
|
F ui/SettingsDialog.ui 2b7c2870e0054b0f4106f495d85d02c0b814df8b
|
||||||
P 59372f35e863ab4a2363baf3b0df87cbb4a183ce
|
P 37e191368a0f6880991fd27fb08ebf1144f6626f
|
||||||
R 9e3e71d3c83ef4dbbdedfee0f5a8b6b5
|
R fdbfaaf7e049e20aebbeead5bf6d1135
|
||||||
U kostas
|
U kostas
|
||||||
Z af213baf2ef19edc096b07b6c3cbac9a
|
Z 25c2de0408c1af282fd060662d16444f
|
||||||
|
@ -1 +1 @@
|
|||||||
37e191368a0f6880991fd27fb08ebf1144f6626f
|
b49ff56d2af6aca465d8b2ce3b5a9455341e7a1c
|
@ -128,11 +128,11 @@ MainWindow::MainWindow(Settings &_settings, QWidget *parent, QString *workspaceP
|
|||||||
ui->fileTableView->horizontalHeader()->setStretchLastSection(true);
|
ui->fileTableView->horizontalHeader()->setStretchLastSection(true);
|
||||||
|
|
||||||
// workspaceTreeView
|
// workspaceTreeView
|
||||||
ui->workspaceTreeView->setModel(&getWorkspace().getDirModel());
|
ui->workspaceTreeView->setModel(&getWorkspace().getTreeModel());
|
||||||
|
|
||||||
header.clear();
|
header.clear();
|
||||||
header << tr("Workspace");
|
header << tr("Workspace");
|
||||||
getWorkspace().getDirModel().setHorizontalHeaderLabels(header);
|
getWorkspace().getTreeModel().setHorizontalHeaderLabels(header);
|
||||||
|
|
||||||
connect( ui->workspaceTreeView->selectionModel(),
|
connect( ui->workspaceTreeView->selectionModel(),
|
||||||
SIGNAL( selectionChanged(const QItemSelection &, const QItemSelection &) ),
|
SIGNAL( selectionChanged(const QItemSelection &, const QItemSelection &) ),
|
||||||
@ -591,7 +591,7 @@ bool MainWindow::refresh()
|
|||||||
setStatus(tr("No workspace detected."));
|
setStatus(tr("No workspace detected."));
|
||||||
enableActions(false);
|
enableActions(false);
|
||||||
getWorkspace().getFileModel().removeRows(0, getWorkspace().getFileModel().rowCount());
|
getWorkspace().getFileModel().removeRows(0, getWorkspace().getFileModel().rowCount());
|
||||||
getWorkspace().getDirModel().removeRows(0, getWorkspace().getFileModel().rowCount());
|
getWorkspace().getTreeModel().removeRows(0, getWorkspace().getFileModel().rowCount());
|
||||||
setWindowTitle(title);
|
setWindowTitle(title);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -600,7 +600,7 @@ bool MainWindow::refresh()
|
|||||||
setStatus(tr("Old repository schema detected. Consider running 'fossil rebuild'"));
|
setStatus(tr("Old repository schema detected. Consider running 'fossil rebuild'"));
|
||||||
enableActions(false);
|
enableActions(false);
|
||||||
getWorkspace().getFileModel().removeRows(0, getWorkspace().getFileModel().rowCount());
|
getWorkspace().getFileModel().removeRows(0, getWorkspace().getFileModel().rowCount());
|
||||||
getWorkspace().getDirModel().removeRows(0, getWorkspace().getFileModel().rowCount());
|
getWorkspace().getTreeModel().removeRows(0, getWorkspace().getFileModel().rowCount());
|
||||||
setWindowTitle(title);
|
setWindowTitle(title);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -691,13 +691,13 @@ static void addPathToTree(QStandardItem &root, const QString &path, const QIcon
|
|||||||
void MainWindow::updateWorkspaceView()
|
void MainWindow::updateWorkspaceView()
|
||||||
{
|
{
|
||||||
// Clear content except headers
|
// Clear content except headers
|
||||||
getWorkspace().getDirModel().removeRows(0, getWorkspace().getDirModel().rowCount());
|
getWorkspace().getTreeModel().removeRows(0, getWorkspace().getTreeModel().rowCount());
|
||||||
|
|
||||||
QStandardItem *workspace = new QStandardItem(getInternalIcon(":icons/icons/Folder-01.png"), tr("Files") );
|
QStandardItem *workspace = new QStandardItem(getInternalIcon(":icons/icons/Folder-01.png"), tr("Files") );
|
||||||
workspace->setData(WorkspaceItem(WorkspaceItem::TYPE_WORKSPACE, ""), ROLE_WORKSPACE_ITEM);
|
workspace->setData(WorkspaceItem(WorkspaceItem::TYPE_WORKSPACE, ""), ROLE_WORKSPACE_ITEM);
|
||||||
workspace->setEditable(false);
|
workspace->setEditable(false);
|
||||||
|
|
||||||
getWorkspace().getDirModel().appendRow(workspace);
|
getWorkspace().getTreeModel().appendRow(workspace);
|
||||||
if(viewMode == VIEWMODE_TREE)
|
if(viewMode == VIEWMODE_TREE)
|
||||||
{
|
{
|
||||||
for(stringset_t::iterator it = getWorkspace().getPaths().begin(); it!=getWorkspace().getPaths().end(); ++it)
|
for(stringset_t::iterator it = getWorkspace().getPaths().begin(); it!=getWorkspace().getPaths().end(); ++it)
|
||||||
@ -714,7 +714,7 @@ void MainWindow::updateWorkspaceView()
|
|||||||
QStandardItem *branches = new QStandardItem(getInternalIcon(":icons/icons/Document Organization Chart-01.png"), "Branches");
|
QStandardItem *branches = new QStandardItem(getInternalIcon(":icons/icons/Document Organization Chart-01.png"), "Branches");
|
||||||
branches->setData(WorkspaceItem(WorkspaceItem::TYPE_BRANCHES, ""), ROLE_WORKSPACE_ITEM);
|
branches->setData(WorkspaceItem(WorkspaceItem::TYPE_BRANCHES, ""), ROLE_WORKSPACE_ITEM);
|
||||||
branches->setEditable(false);
|
branches->setEditable(false);
|
||||||
getWorkspace().getDirModel().appendRow(branches);
|
getWorkspace().getTreeModel().appendRow(branches);
|
||||||
foreach(const QString &branch_name, getWorkspace().getBranches())
|
foreach(const QString &branch_name, getWorkspace().getBranches())
|
||||||
{
|
{
|
||||||
QStandardItem *branch = new QStandardItem(getInternalIcon(":icons/icons/Document Organization Chart-01.png"), branch_name);
|
QStandardItem *branch = new QStandardItem(getInternalIcon(":icons/icons/Document Organization Chart-01.png"), branch_name);
|
||||||
@ -734,7 +734,7 @@ void MainWindow::updateWorkspaceView()
|
|||||||
QStandardItem *tags = new QStandardItem(getInternalIcon(":icons/icons/Book-01.png"), "Tags");
|
QStandardItem *tags = new QStandardItem(getInternalIcon(":icons/icons/Book-01.png"), "Tags");
|
||||||
tags->setData(WorkspaceItem(WorkspaceItem::TYPE_TAGS, ""), ROLE_WORKSPACE_ITEM);
|
tags->setData(WorkspaceItem(WorkspaceItem::TYPE_TAGS, ""), ROLE_WORKSPACE_ITEM);
|
||||||
tags->setEditable(false);
|
tags->setEditable(false);
|
||||||
getWorkspace().getDirModel().appendRow(tags);
|
getWorkspace().getTreeModel().appendRow(tags);
|
||||||
for(QStringMap::const_iterator it=getWorkspace().getTags().begin(); it!=getWorkspace().getTags().end(); ++it)
|
for(QStringMap::const_iterator it=getWorkspace().getTags().begin(); it!=getWorkspace().getTags().end(); ++it)
|
||||||
{
|
{
|
||||||
const QString &tag_name = it.key();
|
const QString &tag_name = it.key();
|
||||||
@ -757,7 +757,7 @@ void MainWindow::updateWorkspaceView()
|
|||||||
QStandardItem *stashes = new QStandardItem(getInternalIcon(":icons/icons/My Documents-01.png"), "Stashes");
|
QStandardItem *stashes = new QStandardItem(getInternalIcon(":icons/icons/My Documents-01.png"), "Stashes");
|
||||||
stashes->setData(WorkspaceItem(WorkspaceItem::TYPE_STASHES, ""), ROLE_WORKSPACE_ITEM);
|
stashes->setData(WorkspaceItem(WorkspaceItem::TYPE_STASHES, ""), ROLE_WORKSPACE_ITEM);
|
||||||
stashes->setEditable(false);
|
stashes->setEditable(false);
|
||||||
getWorkspace().getDirModel().appendRow(stashes);
|
getWorkspace().getTreeModel().appendRow(stashes);
|
||||||
for(stashmap_t::const_iterator it= getWorkspace().getStashes().begin(); it!=getWorkspace().getStashes().end(); ++it)
|
for(stashmap_t::const_iterator it= getWorkspace().getStashes().begin(); it!=getWorkspace().getStashes().end(); ++it)
|
||||||
{
|
{
|
||||||
QStandardItem *stash = new QStandardItem(getInternalIcon(":icons/icons/My Documents-01.png"), it.key());
|
QStandardItem *stash = new QStandardItem(getInternalIcon(":icons/icons/My Documents-01.png"), it.key());
|
||||||
@ -2097,7 +2097,7 @@ void MainWindow::on_workspaceTreeView_customContextMenuRequested(const QPoint &)
|
|||||||
|
|
||||||
// Get first selected item
|
// Get first selected item
|
||||||
const QModelIndex &mi = indices.first();
|
const QModelIndex &mi = indices.first();
|
||||||
QVariant data = getWorkspace().getDirModel().data(mi, ROLE_WORKSPACE_ITEM);
|
QVariant data = getWorkspace().getTreeModel().data(mi, ROLE_WORKSPACE_ITEM);
|
||||||
Q_ASSERT(data.isValid());
|
Q_ASSERT(data.isValid());
|
||||||
WorkspaceItem tv = data.value<WorkspaceItem>();
|
WorkspaceItem tv = data.value<WorkspaceItem>();
|
||||||
|
|
||||||
|
@ -99,6 +99,10 @@ private:
|
|||||||
|
|
||||||
typedef QSet<QString> stringset_t;
|
typedef QSet<QString> stringset_t;
|
||||||
|
|
||||||
|
//////////////////////////////////////////////////////////////////////////
|
||||||
|
// Workspace
|
||||||
|
//////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
class Workspace
|
class Workspace
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -116,7 +120,7 @@ public:
|
|||||||
void scanWorkspace(bool scanLocal, bool scanIgnored, bool scanModified, bool scanUnchanged, const QString &ignoreGlob, UICallback &uiCallback, bool &operationAborted);
|
void scanWorkspace(bool scanLocal, bool scanIgnored, bool scanModified, bool scanUnchanged, const QString &ignoreGlob, UICallback &uiCallback, bool &operationAborted);
|
||||||
|
|
||||||
QStandardItemModel &getFileModel() { return repoFileModel; }
|
QStandardItemModel &getFileModel() { return repoFileModel; }
|
||||||
QStandardItemModel &getDirModel() { return repoDirModel; }
|
QStandardItemModel &getTreeModel() { return repoTreeModel; }
|
||||||
|
|
||||||
filemap_t &getFiles() { return workspaceFiles; }
|
filemap_t &getFiles() { return workspaceFiles; }
|
||||||
stringset_t &getPaths() { return pathSet; }
|
stringset_t &getPaths() { return pathSet; }
|
||||||
@ -135,7 +139,7 @@ private:
|
|||||||
bool isIntegrated;
|
bool isIntegrated;
|
||||||
|
|
||||||
QStandardItemModel repoFileModel;
|
QStandardItemModel repoFileModel;
|
||||||
QStandardItemModel repoDirModel;
|
QStandardItemModel repoTreeModel;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // WORKSPACE_H
|
#endif // WORKSPACE_H
|
||||||
|
Loading…
x
Reference in New Issue
Block a user