Skip to content

Commit 60a3269

Browse files
committed
Git commit: one client per directory (191)
qmdiServer was not supporting remote protocols. This prevents the PluginManager finding the correct client when asking for commits of a specific dir. Now commit form is allocated in a single place and fixes having several commit forms in the UI. closes #191
1 parent fb913a8 commit 60a3269

4 files changed

Lines changed: 5 additions & 5 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ else()
6262
include(cmake/CPM.cmake)
6363
include(cmake/icons-breeze.cmake)
6464

65-
CPMAddPackage("gh:diegoiast/qmdilib#24daf747078184577cb379d945b0b85256d7777a")
65+
CPMAddPackage("gh:diegoiast/qmdilib#1cd56fd0a955ca59e86f4834f3019639f9c22808")
6666
CPMAddPackage("gh:diegoiast/qutepart-cpp#eec2e9ae5b50b591f017296ee743ee2860a280e4")
6767
CPMAddPackage("gh:diegoiast/command-palette-widget#69eb447b61c9d042394a1404c71a0d0b54ac28c0")
6868
CPMAddPackage("gh:diegoiast/KodoTerm#9d016815076a451ad639fa021d46602585e91247")

src/plugins/git/CommitForm.hpp

100755100644
File mode changed.

src/plugins/git/CommitForm.ui

100755100644
File mode changed.

src/plugins/git/GitPlugin.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ qmdiClient *GitPlugin::openFile(const QString &fileName, int, int, int) {
201201
auto manager = getManager();
202202
auto commitForm = new CommitForm(repoDir, this, manager);
203203
mdiServer->addClient(commitForm);
204-
return nullptr;
204+
return commitForm;
205205
}
206206

207207
void GitPlugin::logFileHandler() {
@@ -418,14 +418,14 @@ void GitPlugin::commitHandler() {
418418
return;
419419
}
420420

421-
detectRepoRoot(filename).then(this, [this, manager](const std::tuple<QString, int> &res) {
421+
detectRepoRoot(filename).then(this, [manager](const std::tuple<QString, int> &res) {
422422
auto [repoRoot, exitCode] = res;
423423
if (exitCode != 0 || repoRoot.isEmpty()) {
424424
qDebug() << "Filename is not in any git repo";
425425
return;
426426
}
427-
auto commitForm = new CommitForm(repoRoot, this, manager);
428-
mdiServer->addClient(commitForm);
427+
auto url = QString("git:" + repoRoot);
428+
manager->openFile(url);
429429
});
430430
}
431431

0 commit comments

Comments
 (0)