aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Elvio Basello2010-06-30 20:40:03 +0000
committerGravatar Elvio Basello2010-06-30 20:40:03 +0000
commitddbe02adca4136a510989c219cd9d8846756de0e (patch)
treeec33e3e38dff7f305f814afad8809fca8140e817
parentfix for #817 (diff)
downloadKVIrc-ddbe02adca4136a510989c219cd9d8846756de0e.tar.gz
KVIrc-ddbe02adca4136a510989c219cd9d8846756de0e.tar.bz2
KVIrc-ddbe02adca4136a510989c219cd9d8846756de0e.zip
added bus type to dbus calls, thanks to Skyliner
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@4570 17fca916-40b9-46aa-a4ea-0a15b648b75c
-rw-r--r--src/kvirc/ui/kvi_ircview.cpp7
-rw-r--r--src/kvirc/ui/kvi_ircview.h8
-rw-r--r--src/modules/system/libkvisystem.cpp28
3 files changed, 32 insertions, 11 deletions
diff --git a/src/kvirc/ui/kvi_ircview.cpp b/src/kvirc/ui/kvi_ircview.cpp
index e2fa8f18f..2e7c35239 100644
--- a/src/kvirc/ui/kvi_ircview.cpp
+++ b/src/kvirc/ui/kvi_ircview.cpp
@@ -2052,6 +2052,7 @@ void KviIrcView::showToolsPopup()
m_pToolsPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_SEARCH)),__tr2qs("Hide Find Window"),this,SLOT(toggleToolWidget()));
else
m_pToolsPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_SEARCH)),__tr2qs("Show Find Window"),this,SLOT(toggleToolWidget()));
+
m_pToolsPopup->insertSeparator();
m_pToolsPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_PLUS)),__tr2qs("Zoom In"),this,SLOT(increaseFontSize()));
m_pToolsPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_MINUS)),__tr2qs("Zoom Out"),this,SLOT(decreaseFontSize()));
@@ -2260,7 +2261,8 @@ do_pNext:
}
m_pCursorLine = 0;
repaint();
- if(m_pToolWidget)m_pToolWidget->setFindResult(__tr2qs("Not found"));
+ if(m_pToolWidget)
+ m_pToolWidget->setFindResult(__tr2qs("Not found"));
}
@@ -2314,7 +2316,8 @@ do_pPrev:
m_pCursorLine = 0;
repaint();
- if(m_pToolWidget)m_pToolWidget->setFindResult(__tr2qs("Not found"));
+ if(m_pToolWidget)
+ m_pToolWidget->setFindResult(__tr2qs("Not found"));
}
KviIrcViewLine * KviIrcView::getVisibleLineAt(int yPos)
diff --git a/src/kvirc/ui/kvi_ircview.h b/src/kvirc/ui/kvi_ircview.h
index 5711c0ac9..0eb0d036c 100644
--- a/src/kvirc/ui/kvi_ircview.h
+++ b/src/kvirc/ui/kvi_ircview.h
@@ -73,7 +73,7 @@ public:
void setPaintOnScreen(bool bFlag){setAttribute(Qt::WA_PaintOnScreen,bFlag);} ;
private:
// QDate m_lastLogDay;
- int m_iFlushTimer;
+ int m_iFlushTimer;
KviIrcViewLine * m_pFirstLine;
KviIrcViewLine * m_pCurLine; // Bottom line in the view
KviIrcViewLine * m_pLastLine;
@@ -137,11 +137,11 @@ private:
KviIrcView * m_pMasterView;
QFontMetrics * m_pFm; // assume this valid only inside a paint event (may be 0 in other circumstances)
- QMouseEvent * m_pLastEvent;
+ QMouseEvent * m_pLastEvent;
KviIrcViewToolTip * m_pToolTip;
- bool m_bHaveUnreadedHighlightedMessages;
- bool m_bHaveUnreadedMessages;
+ bool m_bHaveUnreadedHighlightedMessages;
+ bool m_bHaveUnreadedMessages;
QMultiHash<KviIrcViewLine*,KviAnimatedPixmap*> m_hAnimatedSmiles;
public:
diff --git a/src/modules/system/libkvisystem.cpp b/src/modules/system/libkvisystem.cpp
index 8f959ca37..247e870cc 100644
--- a/src/modules/system/libkvisystem.cpp
+++ b/src/modules/system/libkvisystem.cpp
@@ -413,7 +413,7 @@ static bool system_kvs_fnc_hostname(KviKvsModuleFunctionCall *c)
@short:
Performs a DBus call
@syntax:
- <variant> $system.dbus(<service:string>,<path:string>,<interface:string>,<method:string>[,<parameter1:string>[,<parameter2:string>[,...]]])
+ <variant> $system.dbus(<service:string>,<path:string>,<interface:string>,<method:string>[,<bus_type:string>[,<parameter1:string>[,<parameter2:string>[,...]]]])
@description:
This function allows performing simple Dbus calls without executing
an external process. This feature is available ONLY when KDE support
@@ -424,6 +424,8 @@ static bool system_kvs_fnc_hostname(KviKvsModuleFunctionCall *c)
on the remote object and <parameter1>,<parameter2>,... is the list of
parameters to be passed. The <function> name must contain the
trailing parenthesis and parameter specification (see examples).
+ The <bus_type> specifies the bus to connect, use "system" for systemBus or
+ "session" for sessionBus. If it's leaved blank, it will use sessionBus.
The parameters MUST be in the form "type=value"
where "type" is the C++ type of the parameter and value
is the string rappresentation of the parameter data. Currently
@@ -450,7 +452,7 @@ static bool system_kvs_fnc_hostname(KviKvsModuleFunctionCall *c)
static bool system_kvs_fnc_dbus(KviKvsModuleFunctionCall *c)
{
- QString szService, szPath, szInterface, szMethod;
+ QString szService, szPath, szInterface, szMethod, szBusType;
QStringList parms;
KVSM_PARAMETERS_BEGIN(c)
@@ -458,16 +460,32 @@ static bool system_kvs_fnc_dbus(KviKvsModuleFunctionCall *c)
KVSM_PARAMETER("path",KVS_PT_NONEMPTYSTRING,0,szPath)
KVSM_PARAMETER("interface",KVS_PT_NONEMPTYSTRING,0,szInterface)
KVSM_PARAMETER("method",KVS_PT_NONEMPTYSTRING,0,szMethod)
+ KVSM_PARAMETER("bus_type",KVS_PT_STRING,0,szBusType)
KVSM_PARAMETER("parameter_list",KVS_PT_STRINGLIST,KVS_PF_OPTIONAL,parms)
KVSM_PARAMETERS_END(c)
#ifdef COMPILE_KDE_SUPPORT
- QDBusInterface remoteApp(szService, szPath, szInterface);
+ if(szBusType.isEmpty())
+ szBusType = "session";
+
+ QDBusConnection busType("");
+
+ if(szBusType == "system")
+ {
+ busType = QDBusConnection::systemBus();
+ } else if(szBusType == "session"){
+ busType = QDBusConnection::sessionBus();
+ } else {
+ c->warning(__tr2qs("No DBus type specified"));
+ return false;
+ }
+
+ QDBusInterface remoteApp(szService, szPath, szInterface, busType);
if(!remoteApp.isValid())
{
- c->warning(__tr2qs("Invalid DBus interface"));
- return false;
+ c->warning(__tr2qs("Invalid DBus interface"));
+ return false;
}
QList<QVariant> ds;