summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Rosca <[email protected]>2015-05-13 14:14:42 +0200
committerDavid Rosca <[email protected]>2015-05-13 14:14:42 +0200
commit788e7d87e9c340ce5a1e39e7786117c41bd02ab8 (patch)
tree6226fd845563822d0705425799229a4b32e6d409
parenta83bac0689fc6b0f423fc548b64e91643a5d9de5 (diff)
Fix warnings on startup + saving preferences dialog
This fixes warnings on startup: * install xmlgui files to correct location * use correct indexes when adding permanent widget to status bar * use KActionCollection::setDefaultShortcut instead of QShortcut::setShortcut * use correct parser option name in main.cpp This also fixes actions of all buttons in KomparePrefDlg where it connects to correct signals. REVIEW: 123767
-rw-r--r--CMakeLists.txt2
-rw-r--r--kompare_shell.cpp10
-rw-r--r--komparepart/CMakeLists.txt2
-rw-r--r--komparepart/kompare_part.cpp2
-rw-r--r--komparepart/kompareprefdlg.cpp16
-rw-r--r--main.cpp3
6 files changed, 20 insertions, 15 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3152464..b777159 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -74,6 +74,6 @@ install(TARGETS kompare ${INSTALL_TARGETS_DEFAULT_ARGS} )
########### install files ###############
install( PROGRAMS kompare.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} )
-install( FILES kompareui.rc DESTINATION ${DATA_INSTALL_DIR}/kompare )
+install( FILES kompareui.rc DESTINATION ${KXMLGUI_INSTALL_DIR}/kompare )
install( FILES komparenavigationpart.desktop kompareviewpart.desktop DESTINATION ${SERVICETYPES_INSTALL_DIR} )
diff --git a/kompare_shell.cpp b/kompare_shell.cpp
index 0ffcfbc..6d13115 100644
--- a/kompare_shell.cpp
+++ b/kompare_shell.cpp
@@ -44,9 +44,9 @@
#include "kompareinterface.h"
#include "kompareurldialog.h"
-#define ID_N_OF_N_DIFFERENCES 1
-#define ID_N_OF_N_FILES 2
-#define ID_GENERAL 3
+#define ID_N_OF_N_DIFFERENCES 0
+#define ID_N_OF_N_FILES 1
+#define ID_GENERAL 2
Q_LOGGING_CATEGORY(KOMPARESHELL, "kompareshell")
@@ -208,10 +208,10 @@ void KompareShell::setupActions()
a = actionCollection()->addAction("file_compare_files", this, SLOT(slotFileCompareFiles()));
a->setIcon(QIcon::fromTheme("document-open"));
a->setText(i18n("&Compare Files..."));
- a->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_C));
+ actionCollection()->setDefaultShortcut(a, QKeySequence(Qt::CTRL + Qt::Key_C));
a = actionCollection()->addAction("file_blend_url", this, SLOT(slotFileBlendURLAndDiff()));
a->setText(i18n("&Blend URL with Diff..."));
- a->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_B));
+ actionCollection()->setDefaultShortcut(a, QKeySequence(Qt::CTRL + Qt::Key_B));
actionCollection()->addAction(KStandardAction::Quit, this, SLOT( slotFileClose() ));
createStandardStatusBarAction();
diff --git a/komparepart/CMakeLists.txt b/komparepart/CMakeLists.txt
index 04045b2..f4d019e 100644
--- a/komparepart/CMakeLists.txt
+++ b/komparepart/CMakeLists.txt
@@ -37,7 +37,7 @@ install(TARGETS komparepart DESTINATION ${PLUGIN_INSTALL_DIR} )
########### install files ###############
install( FILES komparepart.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
-install( FILES komparepartui.rc DESTINATION ${DATA_INSTALL_DIR}/kompare )
+install( FILES komparepartui.rc DESTINATION ${KXMLGUI_INSTALL_DIR}/kompare )
diff --git a/komparepart/kompare_part.cpp b/komparepart/kompare_part.cpp
index 5e1c515..ab2ab7a 100644
--- a/komparepart/kompare_part.cpp
+++ b/komparepart/kompare_part.cpp
@@ -181,7 +181,7 @@ void KomparePart::setupActions()
m_diffRefresh = actionCollection()->addAction("file_refreshdiff", this, SLOT(slotRefreshDiff()));
m_diffRefresh->setIcon(QIcon::fromTheme("view-refresh"));
m_diffRefresh->setText(i18n("Refresh Diff"));
- m_diffRefresh->setShortcuts(KStandardShortcut::reload());
+ actionCollection()->setDefaultShortcuts(m_diffRefresh, KStandardShortcut::reload());
m_print = actionCollection()->addAction(KStandardAction::Print, this, SLOT( slotFilePrint() ));
m_printPreview = actionCollection()->addAction(KStandardAction::PrintPreview, this, SLOT( slotFilePrintPreview() ));
diff --git a/komparepart/kompareprefdlg.cpp b/komparepart/kompareprefdlg.cpp
index da5ad5d..46eded4 100644
--- a/komparepart/kompareprefdlg.cpp
+++ b/komparepart/kompareprefdlg.cpp
@@ -19,9 +19,11 @@
#include "kompareprefdlg.h"
#include <QTabWidget>
+#include <QPushButton>
#include <klocalizedstring.h>
#include <khelpclient.h>
+#include <kstandardguiitem.h>
#include "diffpage.h"
#include "viewpage.h"
@@ -32,9 +34,11 @@ KomparePrefDlg::KomparePrefDlg( ViewSettings* viewSets, DiffSettings* diffSets )
{
setFaceType( KPageDialog::List );
setWindowTitle( i18n( "Preferences" ) );
- setStandardButtons( QDialogButtonBox::Help|QDialogButtonBox::Ok|QDialogButtonBox::Apply|QDialogButtonBox::Cancel );
+ setStandardButtons( QDialogButtonBox::Help|QDialogButtonBox::Reset|QDialogButtonBox::Ok|QDialogButtonBox::Apply|QDialogButtonBox::Cancel );
setModal( true );
+ KGuiItem::assign( button( QDialogButtonBox::Reset ), KStandardGuiItem::defaults() );
+
// ok i need some stuff in that pref dlg...
//setIconListAllVisible(true);
@@ -52,11 +56,11 @@ KomparePrefDlg::KomparePrefDlg( ViewSettings* viewSets, DiffSettings* diffSets )
// frame = addVBoxPage( i18n( "" ), i18n( "" ), UserIcon( "" ) );
- connect( this, SIGNAL(defaultClicked()), SLOT(slotDefault()) );
- connect( this, SIGNAL(helpClicked()), SLOT(slotHelp()) );
- connect( this, SIGNAL(applyClicked()), SLOT(slotApply()) );
- connect( this, SIGNAL(okClicked()), SLOT(slotOk()) );
- connect( this, SIGNAL(cancelClicked()), SLOT(slotCancel()) );
+ connect( button( QDialogButtonBox::Reset ), &QPushButton::clicked, this, &KomparePrefDlg::slotDefault );
+ connect( button( QDialogButtonBox::Help ), &QPushButton::clicked, this, &KomparePrefDlg::slotHelp );
+ connect( button( QDialogButtonBox::Apply ), &QPushButton::clicked, this, &KomparePrefDlg::slotApply );
+ connect( button( QDialogButtonBox::Ok ), &QPushButton::clicked, this, &KomparePrefDlg::slotOk );
+ connect( button( QDialogButtonBox::Cancel ), &QPushButton::clicked, this, &KomparePrefDlg::slotCancel );
adjustSize();
}
diff --git a/main.cpp b/main.cpp
index d367b9d..2c7443e 100644
--- a/main.cpp
+++ b/main.cpp
@@ -83,6 +83,7 @@ int main(int argc, char *argv[])
aboutData.addCredit( i18n("Bernd Gehrmann"), i18n("Cervisia diff viewer"), "[email protected]" );
QApplication app(argc, argv);
+ app.setWindowIcon(QIcon::fromTheme(QStringLiteral("kompare")));
QCommandLineParser parser;
KAboutData::setApplicationData(aboutData);
parser.addVersionOption();
@@ -119,7 +120,7 @@ int main(int argc, char *argv[])
qCDebug(KOMPARESHELL) << "Argument " << (i+1) << ": " << args.at( i ) ;
}
- if ( parser.isSet( "e" ) )
+ if ( parser.isSet( "e <encoding>" ) )
{
// Encoding given...
// FIXME: Need to implement this...