aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/popup/libkvipopup.cpp
diff options
context:
space:
mode:
authorGravatar Szymon Tomasz Stefanek2015-08-23 05:29:59 +0200
committerGravatar Szymon Tomasz Stefanek2015-08-23 05:29:59 +0200
commit020251ae195e9d38376b7b203d803d4eecfb806a (patch)
tree507c6ea884190600d1086f73bd8e39cf1891d5c2 /src/modules/popup/libkvipopup.cpp
parentProperly handle RPL_WHOISREGNICK. Needs testing on a server that actually sen... (diff)
downloadKVIrc-020251ae195e9d38376b7b203d803d4eecfb806a.tar.gz
KVIrc-020251ae195e9d38376b7b203d803d4eecfb806a.tar.bz2
KVIrc-020251ae195e9d38376b7b203d803d4eecfb806a.zip
Fix #1379
Diffstat (limited to 'src/modules/popup/libkvipopup.cpp')
-rw-r--r--src/modules/popup/libkvipopup.cpp32
1 files changed, 26 insertions, 6 deletions
diff --git a/src/modules/popup/libkvipopup.cpp b/src/modules/popup/libkvipopup.cpp
index 4b2457509..b9399a97c 100644
--- a/src/modules/popup/libkvipopup.cpp
+++ b/src/modules/popup/libkvipopup.cpp
@@ -58,19 +58,29 @@
c->warning(__tr2qs_ctx("Popup menu self-modification is not allowed (the popup is probably open)","kvs")); \
return true; \
} \
- if(!szSubPopupName.isEmpty()) \
+ while(!szSubPopupName.isEmpty()) \
{ \
- pPopup = pPopup->findChildPopupByName(szSubPopupName); \
+ iIdx = szSubPopupName.indexOf(QChar('.')); \
+ QString szTargetPopupName; \
+ if(iIdx >= 0) \
+ { \
+ szTargetPopupName = szSubPopupName.mid(0,iIdx); \
+ szSubPopupName = szSubPopupName.mid(iIdx+1); \
+ } else { \
+ szTargetPopupName = szSubPopupName; \
+ szSubPopupName = QString(); \
+ } \
+ pPopup = pPopup->findChildPopupByName(szTargetPopupName); \
if(!pPopup) \
{ \
if(!c->hasSwitch('q',"quiet")) \
- c->warning(__tr2qs_ctx("Subpopup \"%Q.%Q\" does not exist","kvs"),&szPopupName, &szSubPopupName); \
+ c->warning(__tr2qs_ctx("Popup \"%Q\" does not exist","kvs"),&szTargetPopupName); \
return true; \
} \
if(pPopup->LOCKING_CHECK()) \
{ \
if(!c->hasSwitch('q',"quiet")) \
- c->warning(__tr2qs_ctx("Popup menu self-modification is not allowed (the subpopup is probably open)","kvs")); \
+ c->warning(__tr2qs_ctx("Popup menu self-modification is not allowed (the popup is probably open)","kvs")); \
return true; \
} \
}
@@ -98,12 +108,22 @@
c->warning(__tr2qs_ctx("Popup \"%Q\" does not exist","kvs"),&szPopupName); \
return true; \
} \
- if(!szSubPopupName.isEmpty()) \
+ while(!szSubPopupName.isEmpty()) \
{ \
+ iIdx = szSubPopupName.indexOf(QChar('.')); \
+ QString szTargetPopupName; \
+ if(iIdx >= 0) \
+ { \
+ szTargetPopupName = szSubPopupName.mid(0,iIdx); \
+ szSubPopupName = szSubPopupName.mid(iIdx+1); \
+ } else { \
+ szTargetPopupName = szSubPopupName; \
+ szSubPopupName = QString(); \
+ } \
pPopup = pPopup->findChildPopupByName(szSubPopupName); \
if(!pPopup) \
{ \
- c->warning(__tr2qs_ctx("Subpopup \"%Q.%Q\" does not exist","kvs"),&szPopupName, &szSubPopupName); \
+ c->warning(__tr2qs_ctx("Popup \"%Q\" does not exist","kvs"),&szTargetPopupName); \
return true; \
} \
}