[education/rkward] rkward: Fix placement in case of PDF error

Thomas Friedrichsmeier null at kde.org
Mon Jun 24 22:13:02 BST 2024


Git commit 7bc1e6871255499aaf26beaceebe4ab1541404aa by Thomas Friedrichsmeier.
Committed on 23/06/2024 at 09:23.
Pushed by tfry into branch 'master'.

Fix placement in case of PDF error

M  +1    -1    rkward/autotests/core_test.cpp
M  +1    -0    rkward/windows/rkpdfwindow.cpp
M  +1    -1    rkward/windows/rkworkplace.cpp

https://invent.kde.org/education/rkward/-/commit/7bc1e6871255499aaf26beaceebe4ab1541404aa

diff --git a/rkward/autotests/core_test.cpp b/rkward/autotests/core_test.cpp
index 2edfd9872..a01b7338f 100644
--- a/rkward/autotests/core_test.cpp
+++ b/rkward/autotests/core_test.cpp
@@ -454,7 +454,7 @@ private Q_SLOTS:
 				a->trigger();  // NOTE: Using setChecked(true), here, would not emit the require QActionGroup::triggered() inside RKCommandEditorWindow
 				QVERIFY(a->isChecked());
 				win->doRenderPreview(); // don't wait for debounce timeout
-				waitForAllFinished();
+				waitForAllFinished(4000);
 				// TODO: check that a preview was actually generated
 			}
 		}
diff --git a/rkward/windows/rkpdfwindow.cpp b/rkward/windows/rkpdfwindow.cpp
index 9244c7700..51450bbd5 100644
--- a/rkward/windows/rkpdfwindow.cpp
+++ b/rkward/windows/rkpdfwindow.cpp
@@ -45,6 +45,7 @@ void RKPDFWindow::openURL(const QUrl &url) {
 	RK_TRACE(APP);
 	if (valid) static_cast<KParts::ReadOnlyPart*>(getPart())->openUrl(url);
 	setWindowTitle(url.fileName());
+	Q_EMIT captionChanged(this);
 }
 
 QUrl RKPDFWindow::url() const {
diff --git a/rkward/windows/rkworkplace.cpp b/rkward/windows/rkworkplace.cpp
index 2add815f1..c49cc8080 100644
--- a/rkward/windows/rkworkplace.cpp
+++ b/rkward/windows/rkworkplace.cpp
@@ -480,8 +480,8 @@ RKMDIWindow* RKWorkplace::openPDFWindow(const QUrl &url) {
 		pw->openURL(url);
 	} else {
 		pw = new RKPDFWindow(view());
-		pw->openURL(url);  // needs to be before addwindow, or title won't show correctly
 		addWindow(pw);
+		pw->openURL(url);
 	}
 	return pw;
 }



More information about the rkward-tracker mailing list