[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kconfigwidgets] src: Add DeleteFile and RenameFile standard action.
From:       Leslie Zhai <xiangzhai83 () gmail ! com>
Date:       2016-08-01 1:31:35
Message-ID: E1bU24t-0002Ps-CZ () code ! kde ! org
[Download RAW message or body]

Git commit 8358e634615129554ba699c7b5106f0557ac6998 by Leslie Zhai.
Committed on 01/08/2016 at 01:31.
Pushed by lesliezhai into branch 'master'.

Add DeleteFile and RenameFile standard action.

REVIEW: 128518

M  +15   -0    src/kstandardaction.cpp
M  +40   -1    src/kstandardaction.h
M  +3    -0    src/kstandardaction_p.h

http://commits.kde.org/kconfigwidgets/8358e634615129554ba699c7b5106f0557ac6998

diff --git a/src/kstandardaction.cpp b/src/kstandardaction.cpp
index 2da927f..40f63c4 100644
--- a/src/kstandardaction.cpp
+++ b/src/kstandardaction.cpp
@@ -621,5 +621,20 @@ QAction *aboutKDE(const QObject *recvr, const char *slot, \
QObject *parent)  return KStandardAction::create(AboutKDE, recvr, slot, parent);
 }
 
+QAction *deleteFile(const QObject *recvr, const char *slot, QObject *parent)
+{
+    return KStandardAction::create(DeleteFile, recvr, slot, parent);
+}
+
+QAction *renameFile(const QObject *recvr, const char *slot, QObject *parent)
+{
+    return KStandardAction::create(RenameFile, recvr, slot, parent);
+}
+
+QAction *moveToTrash(const QObject *recvr, const char *slot, QObject *parent)
+{
+    return KStandardAction::create(MoveToTrash, recvr, slot, parent);
+}
+
 }
 
diff --git a/src/kstandardaction.h b/src/kstandardaction.h
index e725f4f..c628066 100644
--- a/src/kstandardaction.h
+++ b/src/kstandardaction.h
@@ -166,7 +166,10 @@ enum StandardAction {
     FullScreen,
     Clear,
     PasteText,
-    SwitchApplicationLanguage
+    SwitchApplicationLanguage,
+    DeleteFile, //< @since 5.25
+    RenameFile, //< @since 5.25
+    MoveToTrash //< @since 5.25
 };
 
 /**
@@ -1061,6 +1064,42 @@ KCONFIGWIDGETS_EXPORT QAction *aboutKDE(const QObject *recvr, \
                const char *slot,
  */
 KSTANDARDACTION_WITH_NEW_STYLE_CONNECT(aboutKDE, AboutKDE)
 
+/**
+ * Delete file.
+ * @since 5.25
+ */
+KCONFIGWIDGETS_EXPORT QAction *deleteFile(const QObject *recvr, const char *slot, \
QObject *parent); +
+/**
+ * Delete file.
+ * @since 5.25
+ */
+KSTANDARDACTION_WITH_NEW_STYLE_CONNECT(deleteFile, DeleteFile)
+
+/**
+ * Rename file.
+ * @since 5.25
+ */
+KCONFIGWIDGETS_EXPORT QAction *renameFile(const QObject *recvr, const char *slot, \
QObject *parent); +
+/**
+ * Rename file.
+ * @since 5.25
+ */
+KSTANDARDACTION_WITH_NEW_STYLE_CONNECT(renameFile, RenameFile)
+
+/**
+ * Move to Trash.
+ * @since 5.25
+ */
+KCONFIGWIDGETS_EXPORT QAction *moveToTrash(const QObject *recvr, const char *slot, \
QObject *parent); +
+/**
+ * Move to Trash.
+ * @since 5.25
+ */
+KSTANDARDACTION_WITH_NEW_STYLE_CONNECT(moveToTrash, MoveToTrash)
+
 }
 
 #endif // KSTDACTION_H
diff --git a/src/kstandardaction_p.h b/src/kstandardaction_p.h
index 3c6adf4..814374e 100644
--- a/src/kstandardaction_p.h
+++ b/src/kstandardaction_p.h
@@ -113,6 +113,9 @@ static const KStandardActionInfo g_rgActionInfo[] = {
     { SwitchApplicationLanguage, KStandardShortcut::SwitchApplicationLanguage, \
"switch_application_language", I18N_NOOP("Switch Application &Language..."), 0, \
                "preferences-desktop-locale" },
     { AboutApp,      KStandardShortcut::AccelNone, "help_about_app", \
                I18N_NOOP("&About %1"), 0, 0 },
     { AboutKDE,      KStandardShortcut::AccelNone, "help_about_kde", \
I18N_NOOP("About &KDE"), 0, "kde" }, +    { DeleteFile,    \
KStandardShortcut::DeleteFile, "deletefile", I18N_NOOP("&Delete File"), 0, \
"edit-delete" }, +    { RenameFile,    KStandardShortcut::RenameFile, "renamefile", \
I18N_NOOP("&Rename File"), 0, "edit-rename" }, +    { MoveToTrash,   \
KStandardShortcut::MoveToTrash, "movetotrash", I18N_NOOP("&Move to Trash"), 0, \
"edit-delete" },  { ActionNone,    KStandardShortcut::AccelNone, 0, 0, 0, 0 }
 };
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic