Closed PeterDaveHello closed 8 years ago
It works.
I'm also wondering if we need to increase import_count
even we bypass importUserphrase()
, so updated to this:
diff --git a/src/view/ChewingEditor.cpp b/src/view/ChewingEditor.cpp
index b1c1961..ad8aa8f 100644
--- a/src/view/ChewingEditor.cpp
+++ b/src/view/ChewingEditor.cpp
@@ -125,8 +125,10 @@ void ChewingEditor::finishFileSelection(const QString& file)
switch (dialogType_) {
case DIALOG_IMPORT:
// Do nothing after the first trigger
- if(import_count++ == 1)
+ if (import_count == 0) {
importUserphrase(file);
+ import_count++;
+ }
qDebug() << "import_count = " << import_count;
It works in my environment (Ubuntu 14.04, fcitx-chewing). And if(import_count==0) makes more sense.
Thanks for your contributions.
For the previous double trigger problem, maybe we should find out the reason why it been triggered twice, not just bypass it.
@PeterDaveHello It might be Qt's problem, reference here: https://bugreports.qt.io/browse/QTBUG-38985
I'll take a look at it, thanks.
Coverage remained the same at 93.714% when pulling b8e235a652bbc49fbdc2250d0723fbb116a911ec on PeterDaveHello:fix-phrases-import into 50c105e5ef002eb85fa5e2b0ff144f612ab4ca4b on chewing:master.