From efe0b61464d1ef3360004590ad43475456aa785d Mon Sep 17 00:00:00 2001 From: kostas Date: Mon, 27 Apr 2015 15:49:05 +0000 Subject: [PATCH] - More fossil "mv" wrapping - stopUI now navigates to "about:blank" FossilOrigin-Name: 77ff1ae8697fa89d87f3ca03fc50cf40ce537f24 --- manifest | 16 ++++++++-------- manifest.uuid | 2 +- src/Bridge.cpp | 7 +++++-- src/Bridge.h | 2 +- src/MainWindow.cpp | 7 ++++++- 5 files changed, 21 insertions(+), 13 deletions(-) diff --git a/manifest b/manifest index 0dacab4..444d00e 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Wrapped\sfossil\s"update" -D 2015-04-27T15:32:28.640 +C -\sMore\sfossil\s"mv"\swrapping\n-\sstopUI\snow\snavigates\sto\s"about:blank" +D 2015-04-27T15:49:05.526 F .travis.yml 77966888a81c4ceee1fcc79bce842c9667ad8a35 F debian/changelog eb4304dfcb6bb66850ec740838090eb50ce1249b F debian/compat b6abd567fa79cbe0196d093a067271361dc6ca8b @@ -184,8 +184,8 @@ F rsrc/icons/fuel.icns 81e535004b62db801a02f3e15d0a33afc9d4070b F rsrc/icons/fuel.ico eb529ab3332a17b9302ef3e851db5b9ebce2a038 F rsrc/icons/fuel.png 40daf53b7f6bdcdd0d6aa5ef433d078ec5ea4342 F rsrc/resources.qrc 4098be128fd6c045db933d041fe8844b14643a6f -F src/Bridge.cpp 9112bd819e4a012eb050c25a4e790aefe1082cd5 -F src/Bridge.h 25b22bbaf5c34f529095921f3f8fb367185d9750 +F src/Bridge.cpp 50996723afa0ebf24dc2e4c0ec93a73ec6c0f9e4 +F src/Bridge.h 52401305a45aa48e147000ebda538719d17ebb6f F src/BrowserWidget.cpp 8b8f545cdff4a4188edc698a1b4777f5df46f056 F src/BrowserWidget.h 764d66aa9a93b890298bd0301097739cb4e16597 F src/CloneDialog.cpp 812ef7d361c16da21540b7047c9d4d5e74f18539 @@ -200,7 +200,7 @@ F src/FileTableView.cpp 5ddf8c391c9a3ac449ec61fb1db837b577afeec2 F src/FileTableView.h 03e56d87c2d46411b9762b87f4d301619aaf18df F src/LoggedProcess.cpp 2a1e5c94bc1e57c8984563e66c210e43a14dc60c F src/LoggedProcess.h 85df7c635c807a5a0e8c4763f17a0752aaff7261 -F src/MainWindow.cpp 946d1422c8540f155d4b8022956319bfeb0d693c +F src/MainWindow.cpp d1a07a3cc3b6b7ee9892b87691d9dee44f7760c7 F src/MainWindow.h a727aea9b2b453c79682f61157b38a76a873060a F src/SettingsDialog.cpp a46cff5e5dd425e3dbdd15632abfd5829f5562b4 F src/SettingsDialog.h 4e2790f581e991c744ae9f86580f1972b8c7ff43 @@ -215,7 +215,7 @@ F ui/CommitDialog.ui 6200f6cabdcf40a20812e811be28e0793f82516f F ui/FileActionDialog.ui 89bb4dc2d0b8adcd41adcb11ec65f2028a09a12d F ui/MainWindow.ui 8677f5c8bca5bf7561d5f64bfdd0cef5157c6ac7 F ui/SettingsDialog.ui 2b7c2870e0054b0f4106f495d85d02c0b814df8b -P 239b8ac44d4dd954633b52d28b68e4cd9937efbc -R 21520105f6d95e2d46dcaeedab9c8d5c +P 11a0f979fc198ad134c95c139547baae81d90050 +R 7c36928b15b28edaefddc669a790ffc2 U kostas -Z 7f5cca5d4e2b24f9dd76444de33be1b8 +Z a63695d7f1d6a5fd1462c09f9c0b905b diff --git a/manifest.uuid b/manifest.uuid index 7433b05..2df0d02 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -11a0f979fc198ad134c95c139547baae81d90050 \ No newline at end of file +77ff1ae8697fa89d87f3ca03fc50cf40ce537f24 \ No newline at end of file diff --git a/src/Bridge.cpp b/src/Bridge.cpp index 9acb129..6b3edc4 100644 --- a/src/Bridge.cpp +++ b/src/Bridge.cpp @@ -258,7 +258,7 @@ bool Bridge::revertFiles(const QStringList& fileList) } //------------------------------------------------------------------------------ -bool Bridge::renameFile(const QString &beforePath, const QString &afterPath) +bool Bridge::renameFile(const QString &beforePath, const QString &afterPath, bool renameLocal) { // Ensure we can rename the file if(!QFileInfo(beforePath).exists() || QFileInfo(afterPath).exists()) @@ -271,7 +271,10 @@ bool Bridge::renameFile(const QString &beforePath, const QString &afterPath) QString wkdir = getCurrentWorkspace() + QDir::separator(); // Also rename the file - return QFile::rename(wkdir+beforePath, wkdir+afterPath); + if(renameLocal && !QFile::rename(wkdir+beforePath, wkdir+afterPath)) + return false; + + return true; } //------------------------------------------------------------------------------ diff --git a/src/Bridge.h b/src/Bridge.h index 58621c2..f404fe6 100644 --- a/src/Bridge.h +++ b/src/Bridge.h @@ -103,7 +103,7 @@ public: bool addFiles(const QStringList& fileList); bool removeFiles(const QStringList& fileList, bool deleteLocal); bool revertFiles(const QStringList& fileList); - bool renameFile(const QString& beforePath, const QString& afterPath); + bool renameFile(const QString& beforePath, const QString& afterPath, bool renameLocal); bool undoRepository(QStringList& result, bool explainOnly); bool updateRepository(QStringList& result, bool explainOnly); private: diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index 1528632..5f3bf06 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -1828,6 +1828,7 @@ bool MainWindow::startUI() void MainWindow::stopUI() { bridge.stopUI(); + ui->webView->load(QUrl("about:blank")); ui->actionFossilUI->setChecked(false); } @@ -2159,7 +2160,7 @@ void MainWindow::on_actionRename_triggered() // Also rename the file QFile::rename(wkdir+fi_before.filePath(), wkdir+fi_after.filePath()); #else - bridge.renameFile(fi_before.filePath(), fi_after.filePath()); + bridge.renameFile(fi_before.filePath(), fi_after.filePath(), true); #endif refresh(); @@ -2547,7 +2548,11 @@ void MainWindow::on_actionRenameFolder_triggered() RepoFile *r = files_to_move[i]; const QString &new_file_path = new_paths[i] + PATH_SEP + r->getFilename(); +#ifndef BRIDGE_ENABLED if(!runFossil(QStringList() << "mv" << QuotePath(r->getFilePath()) << QuotePath(new_file_path))) +#else + if(!bridge.renameFile(r->getFilePath(), new_file_path, false)) +#endif { log(tr("Move aborted due to errors")+"\n"); goto _exit;