Moved currentWorkspace to Bridge
FossilOrigin-Name: a7ac992f6f87abee63c74696cb372a1564250103
This commit is contained in:
13
src/Bridge.h
13
src/Bridge.h
@ -56,6 +56,15 @@ public:
|
||||
|
||||
RepoStatus getRepoStatus();
|
||||
|
||||
void setCurrentWorkspace(const QString &workspace)
|
||||
{
|
||||
currentWorkspace = workspace;
|
||||
}
|
||||
|
||||
const QString &getCurrentWorkspace()
|
||||
{
|
||||
return currentWorkspace;
|
||||
}
|
||||
|
||||
|
||||
bool uiRunning() const;
|
||||
@ -72,10 +81,6 @@ private:
|
||||
(*logCallback)(logTextBrowser, text, isHTML);
|
||||
}
|
||||
|
||||
const QString &getCurrentWorkspace()
|
||||
{
|
||||
return currentWorkspace;
|
||||
}
|
||||
|
||||
QString getFossilPath();
|
||||
|
||||
|
@ -262,7 +262,11 @@ MainWindow::~MainWindow()
|
||||
//-----------------------------------------------------------------------------
|
||||
const QString &MainWindow::getCurrentWorkspace()
|
||||
{
|
||||
#ifndef BRIDGE_ENABLED
|
||||
return currentWorkspace;
|
||||
#else
|
||||
return bridge.getCurrentWorkspace();
|
||||
#endif
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@ -270,13 +274,22 @@ void MainWindow::setCurrentWorkspace(const QString &workspace)
|
||||
{
|
||||
if(workspace.isEmpty())
|
||||
{
|
||||
#ifndef BRIDGE_ENABLED
|
||||
currentWorkspace.clear();
|
||||
#else
|
||||
bridge.setCurrentWorkspace("");
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
QString new_workspace = QFileInfo(workspace).absoluteFilePath();
|
||||
|
||||
#ifndef BRIDGE_ENABLED
|
||||
currentWorkspace = new_workspace;
|
||||
#else
|
||||
bridge.setCurrentWorkspace(new_workspace);
|
||||
#endif
|
||||
|
||||
addWorkspace(new_workspace);
|
||||
|
||||
if(!QDir::setCurrent(new_workspace))
|
||||
@ -2736,11 +2749,11 @@ void MainWindow::dropEvent(QDropEvent *event)
|
||||
QString abspath = finfo.absoluteFilePath();
|
||||
|
||||
// Within the current workspace ?
|
||||
if(abspath.indexOf(currentWorkspace)!=0)
|
||||
if(abspath.indexOf(getCurrentWorkspace())!=0)
|
||||
continue; // skip
|
||||
|
||||
// Remove workspace from full path
|
||||
QString wkpath = abspath.right(abspath.length()-currentWorkspace.length()-1);
|
||||
QString wkpath = abspath.right(abspath.length()-getCurrentWorkspace().length()-1);
|
||||
|
||||
newfiles.append(wkpath);
|
||||
}
|
||||
|
@ -261,7 +261,9 @@ private:
|
||||
QString projectName;
|
||||
QString repositoryFile;
|
||||
QStringList workspaceHistory;
|
||||
#ifndef BRIDGE_ENABLED
|
||||
QString currentWorkspace;
|
||||
#endif
|
||||
ViewMode viewMode;
|
||||
stringset_t selectedDirs; // The directory selected in the tree
|
||||
|
||||
|
Reference in New Issue
Block a user