Page Menu
Home
GnuPG
Search
Configure Global Search
Log In
Files
F34601804
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Size
21 KB
Subscribers
None
View Options
diff --git a/Makefile.am b/Makefile.am
index 9bb378b0..b3b88c0a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,133 +1,133 @@
# Makefile.am - Installer for GnuPG 4 Windows Makefile.
# Copyright (C) 2005, 2008, 2012 g10 Code GmbH
#
# This file is part of GPG4Win.
#
# GPG4Win is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# GPG4Win is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>.
ACLOCAL_AMFLAGS = -I m4
AUTOMAKE_OPTIONS = dist-xz no-dist-gzip
DISTCHECK_CONFIGURE_FLAGS = --host=i686-w64-mingw32
if BUILD_GPG4WIN
po = po
else
po =
endif
if BUILD_GPG4WIN
doc = doc
else
doc =
endif
SUBDIRS = ${po} packages ${doc} src
# find patches -type f | sort | sed 's/$/ \\/' | sed 's/^/ /'
# find patches-appimage -type f | sort | sed 's/$/ \\/' | sed 's/^/ /'
EXTRA_DIST = autogen.sh README.GIT ONEWS \
doc/license-page doc/GPLv3 \
build-aux/git-log-footer build-aux/git-log-fix \
docker/appimage/Dockerfile \
docker/build-appimage-docker-image.sh \
docker/build-gpg4win-docker-image.sh \
docker/gpg4win-bullseye/Dockerfile \
docker/run-appimage-build.sh \
docker/run-gpg4win-build.sh \
patches/extra-cmake-modules/0001-Use-BIN_INSTALL_DIR-data-for-DATAROOTDIR-on-Windows.patch \
patches/kconfig/0001-Read-defaults-from-Windows-registry.patch \
patches/kconfigwidgets/0001-Fix-crash-on-exit-on-Windows.patch \
patches/kconfigwidgets/0001-Make-QDbus-optional.patch \
patches/kcoreaddons/0001-Add-KSharedDataCache-for-Windows.patch \
patches/kiconthemes/0001-Make-DBus-optional.patch \
patches/kleopatra/set-windows-registry.patch \
patches/kleopatra/0001-Revert-new-dependency-to-KCMUtils.patch \
patches/kxmlgui/0001-make-qdbus-optional.patch \
patches/kxmlgui/0004-Cruedly-disable-KSendbugmail.patch \
patches/libkleo/set-cxx-standard.patch \
patches/qtbase/0001-Fix-build-without-std-thread.patch \
patches/qtbase/0001-Gpg4win-qstandardpaths-patch.patch \
patches/qtbase/0002-Gpg4win-theme-names-and-relpaths.patch \
patches/qtsvg/CVE-2023-32573-qtsvg-5.15.patch \
patches/qtbase/CVE-2023-32763-qtbase-5.15.diff \
patches/qttools/disable-most-tools.patch \
patches/kcoreaddons/0001-Fix-MINGW-build.patch \
patches/ki18n/0001-Undef-snprintf-for-windows.patch \
patches/kio/0001-WIP-Remove-dependency-to-dbus.patch \
patches/kservice/0001-Remove-unused-include.patch \
- patches/okular/0001-WIP-Buildfix-with-reduced-depdencies.patch \
+ patches/okular/0001-Build-without-KIOFilewidgets-and-DBUS.patch \
patches/poppler/0001-Explicitly-take-posix-variant-for-mingw-gcc-cross.patch \
patches/kparts/0001-Apply-implicit-android-DBUS-fix-for-Win.patch \
patches/kparts/disable-jobuidelegate.patch \
patches/sonnet/0001-W32-Force-ispellchecker-for-sonnet.patch \
patches/jpeg/fix-redefine.patch \
patches-appimage/qtwayland-5.15.0/00-disable-wayland-server.patch \
patches-appimage/libkleo/set-cxx-standard.patch \
patches-appimage/kmime/set-cxx-standard.patch \
patches-appimage/qtsvg/CVE-2023-32573-qtsvg-5.15.patch \
patches-appimage/qtbase/CVE-2023-32763-qtbase-5.15.diff \
patches-appimage/libkleo/gpg4win-check.patch \
patches-appimage/kleopatra/0001-Revert-new-dependency-to-KCMUtils.patch \
patches-appimage/kleopatra/require-ecm-5.104.patch
copy-news:
cp NEWS doc/website/NEWS.last
copy-release: gpg4win-$(VERSION).tar.bz2 installers/gpg4win-$(VERSION).exe \
installers/gpg4win-light-$(VERSION).exe \
installers/gpg4win-vanilla-$(VERSION).exe
@echo Copying $(VERSION) to $(RELEASEHOST) >&2
@set -e;\
if ssh "$$(echo $(RELEASEHOST)|cut -d: -f -1)" \
test -f "$$(echo $(RELEASEHOST)/gpg4win-$(VERSION).exe|cut -d: -f2-)";\
then echo "This release has already been copied to the server" >&2 ;\
else scp gpg4win-$(VERSION).tar.bz2 \
installers/gpg4win-$(VERSION).exe \
installers/gpg4win-light-$(VERSION).exe \
installers/gpg4win-vanilla-$(VERSION).exe \
installers/gpg4win-src-$(VERSION).exe $(RELEASEHOST)/ ;\
for f in en de ; do \
scp src/README.$$f.txt \
$(RELEASEHOST)/README-$(VERSION).$$f.txt; \
done;\
fi
dist-hook: gen-ChangeLog
gen_start_date = 2012-03-26T00:00:00
.PHONY: gen-ChangeLog
gen-ChangeLog:
set -e; \
if test -d $(top_srcdir)/.git; then \
(cd $(top_srcdir) && \
$(GITLOG_TO_CHANGELOG) --append-dot --tear-off \
--amend=build-aux/git-log-fix \
--since=$(gen_start_date) ) > $(distdir)/cl-t; \
cat $(top_srcdir)/build-aux/git-log-footer >> $(distdir)/cl-t;\
rm -f $(distdir)/ChangeLog; \
mv $(distdir)/cl-t $(distdir)/ChangeLog; \
fi
download: packages/packages.common packages/packages.4 packages/packages.3
(cd packages; ./download.sh)
msi:
$(MAKE) $(AM_MAKEFLAGS) -C src msi
msi-signed:
$(MAKE) $(AM_MAKEFLAGS) -C src msi-signed
msi-upload:
$(MAKE) $(AM_MAKEFLAGS) -C src msi-upload
diff --git a/patches/okular/0001-WIP-Buildfix-with-reduced-depdencies.patch b/patches/okular/0001-Build-without-KIOFilewidgets-and-DBUS.patch
similarity index 60%
rename from patches/okular/0001-WIP-Buildfix-with-reduced-depdencies.patch
rename to patches/okular/0001-Build-without-KIOFilewidgets-and-DBUS.patch
index e48707dc..233878cf 100755
--- a/patches/okular/0001-WIP-Buildfix-with-reduced-depdencies.patch
+++ b/patches/okular/0001-Build-without-KIOFilewidgets-and-DBUS.patch
@@ -1,493 +1,339 @@
-#! /bin/sh
-patch -p1 -l -f $* < $0
-exit $?
-
-From 16452ac27fab19e639721808e13c89a454cc0232 Mon Sep 17 00:00:00 2001
+From edefd0e3e750849edd0008f28cd4d670b3fb7af2 Mon Sep 17 00:00:00 2001
From: Andre Heinecke <aheinecke@gnupg.org>
-Date: Thu, 4 May 2023 14:07:02 +0200
-Subject: [PATCH] WIP: Buildfix with reduced depdencies
-
-This needs to be split up and cleaned up.
-KTextWidgets should only remove the spellchecking and some
-undo behavior in Text annotations
-
-Phonon disables all Media features.
-
-KIOFileWidgets should functionally be replaced for Windows
-with native code but needs testing.
-
-DBus needs probably replacement by Kleopatras variant
-of KUniqueService for the same functionality. For
-now it always opens in new windows.
+Date: Tue, 13 Jun 2023 14:56:49 +0200
+Subject: [PATCH] Build without KIOFilewidgets and DBUS
-The CMake version requirement is just to allow compiling on debian
-stable.
---
+ CMakeLists.txt | 9 ++++++---
+ part/part.cpp | 16 ++++++++++++++++
+ part/part.h | 4 ++++
+ part/presentationwidget.cpp | 6 +++---
+ shell/CMakeLists.txt | 7 ++++++-
+ shell/main.cpp | 1 -
+ shell/okular_main.cpp | 11 +++++++++++
+ shell/shell.cpp | 9 ++++++++-
+ shell/shell.h | 6 +++++-
+ shell/welcomescreen.cpp | 9 +++++++++
+ 10 files changed, 68 insertions(+), 10 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
-index b66bd756f..b5a9c6072 100644
+index b66bd756f..a335cfcc4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.22)
+cmake_minimum_required(VERSION 3.18)
# KDE Application Version, managed by release script
set (RELEASE_SERVICE_VERSION_MAJOR "23")
-@@ -151,8 +151,16 @@ else()
+@@ -151,7 +151,10 @@ else()
endif()
if (BUILD_DESKTOP)
- find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED COMPONENTS DBus)
-- find_package(KF5 ${KF5_REQUIRED_VERSION} REQUIRED COMPONENTS Parts Crash IconThemes TextWidgets)
+ find_package(Qt5DBus ${QT_REQUIRED_VERSION} CONFIG)
+ if (Qt5DBus_FOUND)
+ add_definitions(-DHAVE_DBUS)
+ endif()
-+ find_package(KF5 ${KF5_REQUIRED_VERSION} REQUIRED COMPONENTS Parts Crash IconThemes)
-+
-+ find_package(KF5TextWidgets ${KF5_REQUIRED_VERSION} CONFIG)
-+ if (KF5TextWidgets_FOUND)
-+ add_definitions(-DHAVE_TEXTWIDGETS)
-+ endif()
+ find_package(KF5 ${KF5_REQUIRED_VERSION} REQUIRED COMPONENTS Parts Crash IconThemes TextWidgets)
find_package(KF5Purpose)
- set_okular_optional_package_properties(KF5Purpose PROPERTIES
-@@ -588,13 +596,16 @@ target_link_libraries(okularpart okularcore
+@@ -588,13 +591,13 @@ target_link_libraries(okularpart okularcore
KF5::IconThemes
KF5::ItemViews
KF5::KIOCore
- KF5::KIOFileWidgets
KF5::KIOWidgets
KF5::Parts
KF5::Solid
KF5::WindowSystem
-- KF5::TextWidgets
+ KF5::TextWidgets
)
-+
-+if(KF5TextWidgets_FOUND)
-+ target_link_libraries(okularpart KF5::TextWidgets)
-+endif()
+
if (Phonon4Qt5_FOUND)
target_link_libraries(okularpart Phonon::phonon4qt5)
endif()
-diff --git a/part/annotwindow.cpp b/part/annotwindow.cpp
-index 68bc16f4d..c77c42697 100644
---- a/part/annotwindow.cpp
-+++ b/part/annotwindow.cpp
-@@ -13,7 +13,12 @@
- // qt/kde includes
- #include <KLocalizedString>
- #include <KStandardAction>
-+#ifdef HAVE_TEXTWIDGETS
- #include <KTextEdit>
-+#else
-+#include <QTextEdit>
-+#define KTextEdit QTextEdit
-+#endif
- #include <QAction>
- #include <QApplication>
- #include <QDebug>
-@@ -21,9 +26,11 @@
- #include <QFont>
- #include <QFontInfo>
- #include <QFontMetrics>
-+#include <QKeyEvent>
- #include <QLabel>
- #include <QLayout>
- #include <QMenu>
-+#include <QMouseEvent>
- #include <QPushButton>
- #include <QSizeGrip>
- #include <QStyle>
-@@ -234,7 +241,9 @@ AnnotWindow::AnnotWindow(QWidget *parent, Okular::Annotation *annot, Okular::Doc
-
- connect(textEdit, &KTextEdit::textChanged, this, &AnnotWindow::slotsaveWindowText);
- connect(textEdit, &KTextEdit::cursorPositionChanged, this, &AnnotWindow::slotsaveWindowText);
-+#ifdef HAVE_TEXTWIDGETS
- connect(textEdit, &KTextEdit::aboutToShowContextMenu, this, &AnnotWindow::slotUpdateUndoAndRedoInContextMenu);
-+#endif
- connect(m_document, &Okular::Document::annotationContentsChangedByUndoRedo, this, &AnnotWindow::slotHandleContentsChangedByUndoRedo);
-
- if (!canEditAnnotation) {
-diff --git a/part/annotwindow.h b/part/annotwindow.h
-index 8f48e698a..8d99b1ebd 100644
---- a/part/annotwindow.h
-+++ b/part/annotwindow.h
-@@ -25,6 +25,10 @@ namespace GuiUtils
- class LatexRenderer;
- }
-
-+#ifndef HAVE_TEXTWIDGETS
-+#define KTextEdit QTextEdit
-+#endif
-+
- class KTextEdit;
- class MovableTitle;
- class QMenu;
-diff --git a/part/dlgpresentation.cpp b/part/dlgpresentation.cpp
-index 5dd763b3f..4b4d6c5e2 100644
---- a/part/dlgpresentation.cpp
-+++ b/part/dlgpresentation.cpp
-@@ -10,7 +10,13 @@
-
- #include <KColorButton>
- #include <KLocalizedString>
-+
-+#ifdef HAVE_TEXTWIDGETS
- #include <KPluralHandlingSpinBox>
-+#else
-+#include <QSpinBox>
-+#define KPluralHandlingSpinBox QSpinBox
-+#endif
-
- #include <QApplication>
- #include <QCheckBox>
-@@ -35,7 +41,12 @@ DlgPresentation::DlgPresentation(QWidget *parent)
-
- KPluralHandlingSpinBox *advanceTime = new KPluralHandlingSpinBox(this);
- advanceTime->setPrefix(i18nc("Spinbox prefix: Advance automatically: every n seconds", "every "));
-+#ifdef HAVE_TEXTWIDGETS
- advanceTime->setSuffix(ki18ncp("Advance every %1 seconds", " second", " seconds"));
-+#else
-+ advanceTime->setPrefix(i18nc("Spinbox suffix: Advance automatically: every n seconds", " seconds"));
-+#endif
-+
- advanceTime->setObjectName(QStringLiteral("kcfg_SlidesAdvanceTime"));
-
- QHBoxLayout *advanceAutomaticallyLayout = new QHBoxLayout();
-diff --git a/part/formwidgets.cpp b/part/formwidgets.cpp
-index c2291e4c6..cc737ea9c 100644
---- a/part/formwidgets.cpp
-+++ b/part/formwidgets.cpp
-@@ -614,14 +614,16 @@ TextAreaEdit::TextAreaEdit(Okular::FormFieldText *text, PageView *pageView)
- , FormWidgetIface(this, text)
- {
- setAcceptRichText(text->isRichText());
-+#ifdef HAVE_TEXTWIDGETS
- setCheckSpellingEnabled(text->canBeSpellChecked());
-+ connect(this, &KTextEdit::aboutToShowContextMenu, this, &TextAreaEdit::slotUpdateUndoAndRedoInContextMenu);
-+#endif
- setAlignment(text->textAlignment());
- setPlainText(text->text());
- setUndoRedoEnabled(false);
-
- connect(this, &QTextEdit::textChanged, this, &TextAreaEdit::slotChanged);
- connect(this, &QTextEdit::cursorPositionChanged, this, &TextAreaEdit::slotChanged);
-- connect(this, &KTextEdit::aboutToShowContextMenu, this, &TextAreaEdit::slotUpdateUndoAndRedoInContextMenu);
- m_prevCursorPos = textCursor().position();
- m_prevAnchorPos = textCursor().anchor();
- m_editing = false;
-diff --git a/part/formwidgets.h b/part/formwidgets.h
-index ea0d2fef8..e59276593 100644
---- a/part/formwidgets.h
-+++ b/part/formwidgets.h
-@@ -13,7 +13,12 @@
- #include "core/area.h"
- #include "core/form.h"
-
-+#ifdef HAVE_TEXTWIDGETS
- #include <KTextEdit>
-+#else
-+#include <QTextEdit>
-+#define KTextEdit QTextEdit
-+#endif
- #include <KUrlRequester>
- #include <QCheckBox>
- #include <QComboBox>
-diff --git a/part/pageviewutils.cpp b/part/pageviewutils.cpp
-index 3da2fb52c..4a47cdf33 100644
---- a/part/pageviewutils.cpp
-+++ b/part/pageviewutils.cpp
-@@ -14,6 +14,8 @@
- #include <QMenu>
- #include <QPainter>
- #include <QTimer>
-+#include <QEvent>
-+#include <QResizeEvent>
-
- // local includes
- #include "core/form.h"
diff --git a/part/part.cpp b/part/part.cpp
index 9c22672cf..68303e5b0 100644
--- a/part/part.cpp
+++ b/part/part.cpp
@@ -36,10 +36,13 @@
#include <QLayout>
#include <QMenu>
#include <QMenuBar>
+#include <QMimeDatabase>
+#include <QMimeData>
#include <QPrintDialog>
#include <QPrintPreviewDialog>
#include <QPrinter>
#include <QScrollBar>
+#include <QScopedValueRollback>
#include <QSlider>
#include <QSpinBox>
#include <QStandardPaths>
@@ -125,6 +128,11 @@
#include <memory>
#include <type_traits>
+#ifdef Q_OS_WIN
+#include <windows.h>
+#include <shellapi.h>
+#endif
+
#ifdef OKULAR_KEEP_FILE_OPEN
class FileKeeper
{
@@ -323,6 +331,7 @@ Part::Part(QWidget *parentWidget, QObject *parent, const QVariantList &args)
setupConfigSkeleton(args, componentName());
+#ifdef HAVE_DBUS
numberOfParts++;
if (numberOfParts == 1) {
m_registerDbusName = QStringLiteral("/okular");
@@ -330,6 +339,7 @@ Part::Part(QWidget *parentWidget, QObject *parent, const QVariantList &args)
m_registerDbusName = QStringLiteral("/okular%1").arg(numberOfParts);
}
QDBusConnection::sessionBus().registerObject(m_registerDbusName, this, QDBusConnection::ExportScriptableSlots);
+#endif
// connect the started signal to tell the job the mimetypes we like,
// and get some more information from it
@@ -986,7 +996,9 @@ void Part::setupActions()
Part::~Part()
{
+#ifdef HAVE_DBUS
QDBusConnection::sessionBus().unregisterObject(m_registerDbusName);
+#endif
m_document->removeObserver(this);
@@ -3873,7 +3885,11 @@ void Part::setEditorCmd(const QString &editorCmd)
void Part::slotOpenContainingFolder()
{
+#ifdef Q_OS_WIN
+ ShellExecuteW(NULL, L"explore", (wchar_t *)localFilePath().utf16(), NULL, NULL, SW_SHOWDEFAULT);
+#else
KIO::highlightInFileManager({QUrl(localFilePath())});
+#endif
}
} // namespace Okular
diff --git a/part/part.h b/part/part.h
index 311824984..91b065a83 100644
--- a/part/part.h
+++ b/part/part.h
@@ -20,7 +20,11 @@
#include <QPointer>
#include <QProcess>
#include <QUrl>
+#ifdef HAVE_DBUS
#include <QtDBus> // krazy:exclude=includes
+#else
+#define Q_NOREPLY
+#endif
#include <KCompressionDevice>
#include <KIO/Job>
diff --git a/part/presentationwidget.cpp b/part/presentationwidget.cpp
index bd5192c53..01afad83d 100644
--- a/part/presentationwidget.cpp
+++ b/part/presentationwidget.cpp
@@ -7,9 +7,6 @@
#include "presentationwidget.h"
// qt/kde includes
-#include <QDBusConnection>
-#include <QDBusMessage>
-#include <QDBusReply>
#include <QLoggingCategory>
#include <KActionCollection>
@@ -39,6 +36,9 @@
#include <QValidator>
#ifdef Q_OS_LINUX
+#include <QDBusConnection>
+#include <QDBusMessage>
+#include <QDBusReply>
#include <QDBusUnixFileDescriptor>
#include <unistd.h> // For ::close() for sleep inhibition
#endif
diff --git a/shell/CMakeLists.txt b/shell/CMakeLists.txt
index 597f0b74c..7b83323e3 100644
--- a/shell/CMakeLists.txt
+++ b/shell/CMakeLists.txt
@@ -23,7 +23,12 @@ ecm_add_app_icon(okular_SRCS ICONS ${ICONS_SRCS})
add_executable(okular ${okular_SRCS})
-target_link_libraries(okular KF5::I18n KF5::Parts KF5::WindowSystem KF5::Crash KF5::IconThemes Qt5::DBus)
+target_link_libraries(okular KF5::I18n KF5::Parts KF5::WindowSystem KF5::Crash KF5::IconThemes)
+
+if(TARGET Qt5::DBus)
+ target_link_libraries(okular Qt5::DBus)
+endif()
+
if(TARGET KF5::Activities)
target_compile_definitions(okular PUBLIC -DWITH_KACTIVITIES=1)
diff --git a/shell/main.cpp b/shell/main.cpp
index 35f3aea65..dd08abeaf 100644
--- a/shell/main.cpp
+++ b/shell/main.cpp
@@ -21,7 +21,6 @@
#include <QApplication>
#include <QCommandLineOption>
#include <QCommandLineParser>
-#include <QDBusInterface>
#include <QTextStream>
#include <QtGlobal>
diff --git a/shell/okular_main.cpp b/shell/okular_main.cpp
index c23f46356..43229f71b 100644
--- a/shell/okular_main.cpp
+++ b/shell/okular_main.cpp
@@ -16,8 +16,11 @@
#include <KLocalizedString>
#include <KWindowSystem>
#include <QApplication>
+#ifdef HAVE_DBUS
#include <QDBusInterface>
+#endif
#include <QTextStream>
+#include <QTemporaryFile>
#include "config-okular.h"
#if HAVE_X11
@@ -43,6 +46,9 @@ static QString startupId()
static bool attachUniqueInstance(const QStringList &paths, const QString &serializedOptions)
{
+#ifndef HAVE_DBUS
+ return false;
+#else
if (!ShellUtils::unique(serializedOptions) || paths.count() != 1) {
return false;
}
@@ -66,11 +72,15 @@ static bool attachUniqueInstance(const QStringList &paths, const QString &serial
}
return true;
+#endif
}
// Ask an existing non-unique instance to open new tabs
static bool attachExistingInstance(const QStringList &paths, const QString &serializedOptions)
{
+#ifndef HAVE_DBUS
+ return false;
+#else
if (paths.count() < 1) {
return false;
}
@@ -159,6 +169,7 @@ static bool attachExistingInstance(const QStringList &paths, const QString &seri
bestService->call(QStringLiteral("tryRaise"), startupId());
return true;
+#endif
}
namespace Okular
diff --git a/shell/shell.cpp b/shell/shell.cpp
index 970dafb82..cbf68d419 100644
--- a/shell/shell.cpp
+++ b/shell/shell.cpp
@@ -36,11 +36,15 @@
#include <KWindowSystem>
#include <KXMLGUIFactory>
#include <QApplication>
+#ifdef HAVE_DBUS
#include <QDBusConnection>
+#endif
#include <QDockWidget>
#include <QDragMoveEvent>
#include <QFileDialog>
#include <QMenuBar>
+#include <QMimeDatabase>
+#include <QMimeData>
#include <QObject>
#include <QScreen>
#include <QTabBar>
@@ -237,6 +241,7 @@ Shell::Shell(const QString &serializedOptions)
readSettings();
m_unique = ShellUtils::unique(serializedOptions);
+#ifdef HAVE_DBUS
if (m_unique) {
m_unique = QDBusConnection::sessionBus().registerService(QStringLiteral("org.kde.okular"));
if (!m_unique) {
@@ -258,7 +263,7 @@ Shell::Shell(const QString &serializedOptions)
}
QDBusConnection::sessionBus().registerObject(QStringLiteral("/okularshell"), this, QDBusConnection::ExportScriptableSlots);
-
+#endif
// Make sure that the welcome scren is visible on startup.
showWelcomeScreen();
} else {
@@ -333,9 +338,11 @@ Shell::~Shell()
}
m_tabs.clear();
}
+#ifdef HAVE_DBUS
if (m_unique) {
QDBusConnection::sessionBus().unregisterService(QStringLiteral("org.kde.okular"));
}
+#endif
delete m_tabWidget;
}
diff --git a/shell/shell.h b/shell/shell.h
index facffe33b..a864cb72e 100644
--- a/shell/shell.h
+++ b/shell/shell.h
@@ -20,7 +20,11 @@
#include <kparts/readwritepart.h>
#include <QStackedWidget>
-#include <QtDBus> // krazy:exclude=includes
+#ifdef HAVE_DBUS
+#include <QtDBus> // krazy:exclude=include
+#else
+#define Q_NOREPLY
+#endif
#include "welcomescreen.h"
diff --git a/shell/welcomescreen.cpp b/shell/welcomescreen.cpp
index 1e4bff15e..1066c5f18 100644
--- a/shell/welcomescreen.cpp
+++ b/shell/welcomescreen.cpp
@@ -21,6 +21,11 @@
#include "recentitemsmodel.h"
+#ifdef Q_OS_WIN
+#include <windows.h>
+#include <shellapi.h>
+#endif
+
class RecentsListItemDelegate : public QStyledItemDelegate
{
Q_OBJECT
@@ -78,7 +83,11 @@ public:
showDirectoryAction->setIcon(QIcon::fromTheme(QStringLiteral("document-open-folder")));
connect(showDirectoryAction, &QAction::triggered, this, [item]() {
if (item->url.isLocalFile()) {
+#ifdef Q_OS_WIN
+ ShellExecuteW(NULL, L"explore", (wchar_t *)item->url.toLocalFile().utf16(), NULL, NULL, SW_SHOWDEFAULT);
+#else
KIO::highlightInFileManager({item->url});
+#endif
}
});
menu.addAction(showDirectoryAction);
+--
+2.41.0
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Sun, Jan 18, 4:05 PM (2 h, 4 m)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
d4/d8/6f0c1cd94e4a9b0891bcf64b5576
Attached To
rW Gpg4win
Event Timeline
Log In to Comment