Commit 2d54f7da authored by Andrey Butirsky's avatar Andrey Butirsky
Browse files

fix no menu access for upgraded users

fixes #14

We also move the migration code out of the app itself to `kconf_update` framework
parent a4139243
Pipeline #246081 passed with stage
in 1 minute and 52 seconds
add_subdirectory(icons)
add_subdirectory(kconf_update)
include_directories(${CMAKE_BINARY_DIR}) # for version.h generated by cmake
include_directories(${CMAKE_SOURCE_DIR}/part) # for part's interface.h
......@@ -69,6 +70,7 @@ configure_file(
install(TARGETS ark ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/org.kde.ark.desktop DESTINATION ${KDE_INSTALL_APPDIR})
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/org.kde.ark.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR})
install(FILES arkrc DESTINATION ${KDE_INSTALL_CONFDIR})
############ ark_extract_here plugin ###############
......
[MainWindow]
MenuBar=Disabled
install(FILES ark.upd
DESTINATION ${KDE_INSTALL_KCONFUPDATEDIR})
install(PROGRAMS ark_add_hamburgermenu_to_toolbar.sh
DESTINATION ${KDE_INSTALL_KCONFUPDATEDIR})
Version=5
Id=add-hamburgermenu-to-toolbar
Script=ark_add_hamburgermenu_to_toolbar.sh
#!/bin/sh
sed --regexp-extended --null-data --in-place '
s/(<ToolBar.*)(<\/ToolBar>)/\1<Spacer\/>\n<Action name="hamburger_menu"\/>\n\2/
' \
`qtpaths --locate-file GenericDataLocation kxmlgui5/ark/ark_part.rc`
......@@ -10,13 +10,11 @@
#include "mainwindow.h"
#include "ark_debug.h"
#include "archive_kerfuffle.h"
#include "createdialog.h"
#include "settingsdialog.h"
#include "settingspage.h"
#include "pluginmanager.h"
#include "interface.h"
#include "settings.h"
#include <KParts/ReadWritePart>
#include <KPluginFactory>
......@@ -30,12 +28,12 @@
#include <KXMLGUIFactory>
#include <KConfigSkeleton>
#include <KToolBar>
#include <QMenuBar>
#include <QApplication>
#include <QDragEnterEvent>
#include <QDragMoveEvent>
#include <QFileDialog>
#include <QMenuBar>
#include <QMimeData>
#include <QPointer>
#include <QStatusBar>
......@@ -133,11 +131,6 @@ bool MainWindow::loadPart()
// needs to be above createGUI()
KHamburgerMenu * const hamburgerMenu = KStandardAction::hamburgerMenu(nullptr, nullptr, m_part->actionCollection());
setXMLFile(QStringLiteral("arkui.rc"));
setupGUI(ToolBar | Keys | Save);
createGUI(m_part);
connect(hamburgerMenu, &KHamburgerMenu::aboutToShowMenu,
this, &MainWindow::updateHamburgerMenu);
hamburgerMenu->setMenuBar(menuBar());
......@@ -145,9 +138,11 @@ bool MainWindow::loadPart()
QAction * const showMenuBarAction = actionCollection()->action(
QLatin1String(KStandardAction::name(KStandardAction::ShowMenubar)));
hamburgerMenu->setShowMenuBarAction(showMenuBarAction);
if (ArkSettings::version() < 1) {
menuBar()->hide();
}
setXMLFile(QStringLiteral("arkui.rc"));
setupGUI(ToolBar | Keys | Save);
createGUI(m_part);
// FIXME: workaround for BUG 171080
showMenuBarAction->setChecked(!menuBar()->isHidden());
......@@ -303,9 +298,6 @@ void MainWindow::closeEvent(QCloseEvent *event)
}
}
ArkSettings::setVersion(1);
ArkSettings::self()->save();
KParts::MainWindow::closeEvent(event);
}
......
......@@ -17,10 +17,6 @@
</choices>
<default>Preview</default>
</entry>
<entry name="Version" type="Int">
<label>Internal config version of Ark, mainly used to determine whether an updated version of Ark is running, so as to migrate config entries that were removed/renamed ...etc</label>
<default>0</default>
</entry>
</group>
<group name="Extraction">
<entry name="openDestinationFolderAfterExtraction" type="Bool">
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment