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

List:       kde-commits
Subject:    [skrooge/kf5] /: KF5
From:       Stephane Mankowski <stephane () mankowski ! fr>
Date:       2014-08-31 20:34:48
Message-ID: E1XOBpo-0005Vn-1U () scm ! kde ! org
[Download RAW message or body]

Git commit 31610ad05d8fc8c20f057edb8d5804f9ee930de9 by Stephane Mankowski.
Committed on 31/08/2014 at 20:34.
Pushed by smankowski into branch 'kf5'.

KF5

M  +5    -7    plugins/generic/skg_bookmark/skgbookmarkplugin.cpp
M  +1    -1    plugins/generic/skg_bookmark/skgbookmarkplugin.h
M  +2    -4    skgbasegui/skgmainpanel.cpp
M  +4    -4    skgbasegui/skgtreeview.cpp
M  +18   -12   skgbasemodeler/skgdocument.cpp

http://commits.kde.org/skrooge/31610ad05d8fc8c20f057edb8d5804f9ee930de9

diff --git a/plugins/generic/skg_bookmark/skgbookmarkplugin.cpp \
b/plugins/generic/skg_bookmark/skgbookmarkplugin.cpp index 479db06..6bdcfbd 100644
--- a/plugins/generic/skg_bookmark/skgbookmarkplugin.cpp
+++ b/plugins/generic/skg_bookmark/skgbookmarkplugin.cpp
@@ -102,9 +102,7 @@ bool SKGBookmarkPlugin::setupActions(SKGDocument* iDocument, \
const QStringList&  
     // Bookmark
     m_bookmarkAction = new \
KToolBarPopupAction(QIcon::fromTheme("bookmark-new-list"), i18nc("Verb, action to \
                display bookmarks", "Bookmarks"), this);
-    connect(m_bookmarkAction, &KToolBarPopupAction::triggered, [ = ]() {
-        this->onOpenBookmark();
-    });
+    connect(m_bookmarkAction, &KToolBarPopupAction::triggered, this, \
&SKGBookmarkPlugin::onOpenBookmark);  m_bookmarkMenu = \
static_cast<QMenu*>(m_bookmarkAction->menu());  if (m_bookmarkMenu) {
         m_bookmarkMenu->setProperty("id", 0);
@@ -267,12 +265,12 @@ void SKGBookmarkPlugin::goHome()
     }
 }
 
-void SKGBookmarkPlugin::onOpenBookmark(Qt::MouseButtons iMouse, \
Qt::KeyboardModifiers iKeyboard) +void SKGBookmarkPlugin::onOpenBookmark()
 {
     QAction* callerAction = qobject_cast<QAction*>(this->sender());
     if (callerAction) {
         SKGNodeObject node(m_currentDocument, callerAction->data().toInt());
-        SKGBookmarkPluginDockWidget::openBookmark(node, iMouse & Qt::MidButton || \
iKeyboard & Qt::ControlModifier); +        \
SKGBookmarkPluginDockWidget::openBookmark(node, QGuiApplication::mouseButtons() & \
Qt::MidButton || QApplication::keyboardModifiers() & Qt::ControlModifier);  }
 }
 
@@ -339,7 +337,7 @@ void SKGBookmarkPlugin::onShowBookmarkMenu()
                     act->setText(node.getName());
                     act->setIcon(node.getIcon());
                     act->setData(node.getID());
-                    connect(act, &QAction::triggered, [ = ] \
{this->onOpenBookmark();}); +                    connect(act, &QAction::triggered, \
this, &SKGBookmarkPlugin::onOpenBookmark);  }
             }
         }
@@ -358,7 +356,7 @@ void SKGBookmarkPlugin::onShowBookmarkMenu()
                 act->setText(i18nc("Action", "Open all"));
                 act->setIcon(QIcon::fromTheme("skg_open"));
                 act->setData(idParent);
-                connect(act, &QAction::triggered, [ = ] {this->onOpenBookmark();});
+                connect(act, &QAction::triggered, this, \
&SKGBookmarkPlugin::onOpenBookmark);  }
             if (SKGMainPanel::getMainPanel()->currentPageIndex() >= 0) {
                 // Bookmark current here
diff --git a/plugins/generic/skg_bookmark/skgbookmarkplugin.h \
b/plugins/generic/skg_bookmark/skgbookmarkplugin.h index 60fbc3f..0c53d1a 100644
--- a/plugins/generic/skg_bookmark/skgbookmarkplugin.h
+++ b/plugins/generic/skg_bookmark/skgbookmarkplugin.h
@@ -108,7 +108,7 @@ private Q_SLOTS:
     void importStandardBookmarks();
     void goHome();
 
-    void onOpenBookmark(Qt::MouseButtons iMouse = Qt::LeftButton, \
Qt::KeyboardModifiers iKeyboard = Qt::NoModifier); +    void onOpenBookmark();
     void onAddBookmark();
     void onShowBookmarkMenu();
 
diff --git a/skgbasegui/skgmainpanel.cpp b/skgbasegui/skgmainpanel.cpp
index b9bc423..81370c9 100644
--- a/skgbasegui/skgmainpanel.cpp
+++ b/skgbasegui/skgmainpanel.cpp
@@ -496,9 +496,7 @@ SKGMainPanel::SKGMainPanel(QSplashScreen* iSplashScreen, \
                SKGDocument* iDocument,
                                 actionCollection()->setDefaultShortcut(newAction, \
QString(shortCutPrefix % SKGServices::intToString(shortCutIndex)));  }
                         }
-                        connect(newAction, &QAction::triggered, [ = ]() {
-                            this->onOpenContext();
-                        });
+                        connect(newAction, &QAction::triggered, this, \
&SKGMainPanel::onOpenContext);  
                         contextActionList.append(newAction);
 
@@ -1886,7 +1884,7 @@ void SKGMainPanel::onOpenContext()
         cpage = d->ui.kContextList->currentRow();
     }
     if (cpage != -1) {
-        openPage(cpage, QApplication::keyboardModifiers() &Qt::ControlModifier || \
d->m_middleClick /*TODO KF5 || iMouse & Qt::MidButton || iKeyboard & \
Qt::ControlModifier*/); +        openPage(cpage, QApplication::keyboardModifiers() \
&Qt::ControlModifier || d->m_middleClick || QGuiApplication::mouseButtons() & \
Qt::MidButton);  }
     d->m_middleClick = false;
 }
diff --git a/skgbasegui/skgtreeview.cpp b/skgbasegui/skgtreeview.cpp
index b5d7bb1..02d2ec7 100644
--- a/skgbasegui/skgtreeview.cpp
+++ b/skgbasegui/skgtreeview.cpp
@@ -91,7 +91,7 @@ SKGTreeView::SKGTreeView(QWidget* iParent)
 
     //
     QAction* actCopy = KStandardAction::copy(this, SLOT(copy()), NULL);
-    // TODO(Stephane MANKOWSKI) KF5 actCopy->setShortcutConfigurable(false);
+    actCopy->setProperty("isShortcutConfigurable", false);
     actCopy->setShortcutContext(Qt::WidgetShortcut);
     if (SKGMainPanel::getMainPanel()) {
         SKGMainPanel::getMainPanel()->registerGlobalAction("edit_copy", actCopy);
@@ -100,17 +100,17 @@ SKGTreeView::SKGTreeView(QWidget* iParent)
 
     m_actExpandAll = new QAction(QIcon::fromTheme("format-indent-more"), \
i18nc("Noun, user action", "Expand all"), this);  m_actExpandAll->setShortcut(Qt::ALT \
                + Qt::Key_Plus);
-    // TODO(Stephane MANKOWSKI) KF5 m_actExpandAll->setShortcutConfigurable(false);
+    m_actExpandAll->setProperty("isShortcutConfigurable", false);
     m_actExpandAll->setShortcutContext(Qt::WidgetShortcut);
     connect(m_actExpandAll, &QAction::triggered, this, &SKGTreeView::expandAll);
     if (SKGMainPanel::getMainPanel()) {
         SKGMainPanel::getMainPanel()->registerGlobalAction("edit_expandall", \
m_actExpandAll);  }
     insertGlobalAction("edit_expandall");
-
+ 
     m_actCollapseAll = new QAction(QIcon::fromTheme("format-indent-less"), \
i18nc("Noun, user action", "Collapse all"), this);  \
                m_actCollapseAll->setShortcut(Qt::ALT + Qt::Key_Minus);
-    // TODO(Stephane MANKOWSKI) KF5 \
m_actCollapseAll->setShortcutConfigurable(false); +    \
m_actCollapseAll->setProperty("isShortcutConfigurable", false);  \
                m_actCollapseAll->setShortcutContext(Qt::WidgetShortcut);
     connect(m_actCollapseAll, &QAction::triggered, this, &SKGTreeView::collapseAll);
     if (SKGMainPanel::getMainPanel()) {
diff --git a/skgbasemodeler/skgdocument.cpp b/skgbasemodeler/skgdocument.cpp
index 5ad93b7..d77b30c 100644
--- a/skgbasemodeler/skgdocument.cpp
+++ b/skgbasemodeler/skgdocument.cpp
@@ -210,6 +210,22 @@ static void capitalizeFunction(sqlite3_context* context, int \
/*argc*/, sqlite3_v  }
 }
 
+static void addSqliteAddon(QSqlDatabase* iDb)
+{
+    sqlite3* sqlite_handle = iDb->driver()->handle().value<sqlite3*>();
+    if (sqlite_handle) {
+        sqlite3_create_function(sqlite_handle, "regexp", 2, SQLITE_UTF16 | 0x800, \
NULL, &regexpFunction, NULL, NULL); +        sqlite3_create_function(sqlite_handle, \
"wildcard", 2, SQLITE_UTF16 | 0x800, NULL, &wildcardFunction, NULL, NULL); +        \
sqlite3_create_function(sqlite_handle, "word", 2, SQLITE_UTF16 | 0x800, NULL, \
&wordFunction, NULL, NULL); +        sqlite3_create_function(sqlite_handle, "todate", \
2, SQLITE_UTF16 | 0x800, NULL, &dateFunction, NULL, NULL); +        \
sqlite3_create_function(sqlite_handle, "period", 2, SQLITE_UTF16 | 0x800, NULL, \
&periodFunction, NULL, NULL); +        sqlite3_create_function(sqlite_handle, \
"tocurrency", 2, SQLITE_UTF16 | 0x800, NULL, &currencyFunction, NULL, NULL); +        \
sqlite3_create_function(sqlite_handle, "upper", 1, SQLITE_UTF16 | 0x800, NULL, \
&upperFunction, NULL, NULL); +        sqlite3_create_function(sqlite_handle, "lower", \
1, SQLITE_UTF16 | 0x800, NULL, &lowerFunction, NULL, NULL); +        \
sqlite3_create_function(sqlite_handle, "capitalize", 1, SQLITE_UTF16 | 0x800, NULL, \
&capitalizeFunction, NULL, NULL); +    }
+}
+
 SKGDocument::SKGDocument()
     : QObject(), m_lastSavedTransaction(0), m_progressFunction(NULL), \
                m_progressData(NULL),
       m_currentFileName(""), m_currentDatabase(NULL),  m_inundoRedoTransaction(0), \
m_currentTransaction(0), @@ -1212,18 +1228,7 @@ SKGError SKGDocument::load(const \
QString& iName, const QString& iPassword, bool  
         // Add custom sqlite functions
         IFOK(err) {
-            sqlite3* sqlite_handle = \
                getDatabase()->driver()->handle().value<sqlite3*>();
-            if (sqlite_handle) {
-                sqlite3_create_function(sqlite_handle, "regexp", 2, SQLITE_UTF16 | \
                0x800, NULL, &regexpFunction, NULL, NULL);
-                sqlite3_create_function(sqlite_handle, "wildcard", 2, SQLITE_UTF16 | \
                0x800, NULL, &wildcardFunction, NULL, NULL);
-                sqlite3_create_function(sqlite_handle, "word", 2, SQLITE_UTF16 | \
                0x800, NULL, &wordFunction, NULL, NULL);
-                sqlite3_create_function(sqlite_handle, "todate", 2, SQLITE_UTF16 | \
                0x800, NULL, &dateFunction, NULL, NULL);
-                sqlite3_create_function(sqlite_handle, "period", 2, SQLITE_UTF16 | \
                0x800, NULL, &periodFunction, NULL, NULL);
-                sqlite3_create_function(sqlite_handle, "tocurrency", 2, SQLITE_UTF16 \
                | 0x800, NULL, &currencyFunction, NULL, NULL);
-                sqlite3_create_function(sqlite_handle, "upper", 1, SQLITE_UTF16 | \
                0x800, NULL, &upperFunction, NULL, NULL);
-                sqlite3_create_function(sqlite_handle, "lower", 1, SQLITE_UTF16 | \
                0x800, NULL, &lowerFunction, NULL, NULL);
-                sqlite3_create_function(sqlite_handle, "capitalize", 1, SQLITE_UTF16 \
                | 0x800, NULL, &capitalizeFunction, NULL, NULL);
-            }
+            addSqliteAddon( getDatabase());
         }
 
         if (!m_directAccessDb) {
@@ -1422,6 +1427,7 @@ SKGError SKGDocument::saveAs(const QString& name, bool \
overwrite)  QSqlError sqlErr = fileDb->lastError();
                                 err = SKGError(SQLLITEERROR + sqlErr.number(), \
sqlErr.text());  } else {
+                                addSqliteAddon(fileDb);
                                 IFOKDO(err, SKGServices::copySqliteDatabase(fileDb, \
m_currentDatabase, false))  }
 


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

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