[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdesdk/dolphin-plugins/svn
From: Peter Penz <peter.penz () gmx ! at>
Date: 2010-05-01 17:57:00
Message-ID: 20100501175700.1B235AC8AB () svn ! kde ! org
[Download RAW message or body]
SVN commit 1121564 by ppenz:
Allow to configure, whether a remote updates should be shown. Per default remote updates are not shown.
BUG: 231353
M +3 -4 CMakeLists.txt
M +27 -1 fileviewsvnplugin.cpp
M +3 -0 fileviewsvnplugin.h
--- trunk/KDE/kdesdk/dolphin-plugins/svn/CMakeLists.txt #1121563:1121564
@@ -2,11 +2,10 @@
include_directories( ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ${LIBKONQ_INCLUDE_DIR} ${QIMAGEBLITZ_INCLUDES} )
-set(fileviewsvnplugin_SRCS
- fileviewsvnplugin.cpp
-)
-
+set(fileviewsvnplugin_SRCS fileviewsvnplugin.cpp)
+kde4_add_kcfg_files(fileviewsvnplugin_SRCS fileviewsvnpluginsettings.kcfgc)
kde4_add_plugin(fileviewsvnplugin ${fileviewsvnplugin_SRCS})
target_link_libraries(fileviewsvnplugin ${KDE4_KIO_LIBS} ${LIBKONQ_LIBRARY})
install(FILES fileviewsvnplugin.desktop DESTINATION ${SERVICES_INSTALL_DIR})
+install(FILES fileviewsvnpluginsettings.kcfg DESTINATION ${KCFG_INSTALL_DIR})
install(TARGETS fileviewsvnplugin DESTINATION ${PLUGIN_INSTALL_DIR})
--- trunk/KDE/kdesdk/dolphin-plugins/svn/fileviewsvnplugin.cpp #1121563:1121564
@@ -19,6 +19,8 @@
#include "fileviewsvnplugin.h"
+#include "fileviewsvnpluginsettings.h"
+
#include <kaction.h>
#include <kdemacros.h>
#include <kdialog.h>
@@ -50,6 +52,7 @@
m_commitAction(0),
m_addAction(0),
m_removeAction(0),
+ m_showUpdatesAction(0),
m_command(),
m_errorMsg(),
m_operationCompletedMsg(),
@@ -87,6 +90,13 @@
m_removeAction->setText(i18nc("@item:inmenu", "SVN Delete"));
connect(m_removeAction, SIGNAL(triggered()),
this, SLOT(removeFiles()));
+
+ m_showUpdatesAction = new KAction(this);
+ m_showUpdatesAction->setCheckable(true);
+ m_showUpdatesAction->setText(i18nc("@item:inmenu", "Show SVN Updates"));
+ m_showUpdatesAction->setChecked(FileViewSvnPluginSettings::showUpdates());
+ connect(m_showUpdatesAction, SIGNAL(toggled(bool)),
+ this, SLOT(slotShowUpdatesToggled(bool)));
}
FileViewSvnPlugin::~FileViewSvnPlugin()
@@ -113,7 +123,11 @@
}
QStringList arguments;
- arguments << QLatin1String("status") << QLatin1String("--show-updates") << directory;
+ arguments << QLatin1String("status");
+ if (FileViewSvnPluginSettings::showUpdates()) {
+ arguments << QLatin1String("--show-updates");
+ }
+ arguments << directory;
QProcess process;
process.start(QLatin1String("svn"), arguments);
@@ -225,6 +239,7 @@
actions.append(m_commitAction);
actions.append(m_addAction);
actions.append(m_removeAction);
+ actions.append(m_showUpdatesAction);
return actions;
}
@@ -245,6 +260,7 @@
actions.append(m_updateAction);
actions.append(m_showLocalChangesAction);
actions.append(m_commitAction);
+ actions.append(m_showUpdatesAction);
return actions;
}
@@ -348,6 +364,16 @@
emit errorMessage(m_errorMsg);
}
+void FileViewSvnPlugin::slotShowUpdatesToggled(bool checked)
+{
+ FileViewSvnPluginSettings* settings = FileViewSvnPluginSettings::self();
+ Q_ASSERT(settings != 0);
+ settings->setShowUpdates(checked);
+ settings->writeConfig();
+
+ emit versionStatesChanged();
+}
+
void FileViewSvnPlugin::execSvnCommand(const QString& svnCommand,
const QString& infoMsg,
const QString& errorMsg,
--- trunk/KDE/kdesdk/dolphin-plugins/svn/fileviewsvnplugin.h #1121563:1121564
@@ -53,6 +53,8 @@
void slotOperationCompleted(int exitCode, QProcess::ExitStatus exitStatus);
void slotOperationError();
+ void slotShowUpdatesToggled(bool checked);
+
private:
/**
* Executes the command "svn {svnCommand}" for the files that have been
@@ -80,6 +82,7 @@
QAction* m_commitAction;
QAction* m_addAction;
QAction* m_removeAction;
+ QAction* m_showUpdatesAction;
QString m_command;
QString m_errorMsg;
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic