aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/spaste/libkvispaste.cpp
diff options
context:
space:
mode:
authorGravatar Szymon Tomasz Stefanek2010-07-14 13:31:37 +0000
committerGravatar Szymon Tomasz Stefanek2010-07-14 13:31:37 +0000
commit484d98ded2038f4dd262d546b4e0fe460d907bd4 (patch)
tree4e9541dab6a937b8f580912e8c7d6decce42ef68 /src/modules/spaste/libkvispaste.cpp
parentupdated some mediaplayer homepage urls and some other typos, thanks xoffice (diff)
downloadKVIrc-484d98ded2038f4dd262d546b4e0fe460d907bd4.tar.gz
KVIrc-484d98ded2038f4dd262d546b4e0fe460d907bd4.tar.bz2
KVIrc-484d98ded2038f4dd262d546b4e0fe460d907bd4.zip
Rewrite parts of the regchan module in order to
avoid the heavy usage of pointers. Add some new nice debug macros and tools. git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@4669 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src/modules/spaste/libkvispaste.cpp')
-rw-r--r--src/modules/spaste/libkvispaste.cpp39
1 files changed, 20 insertions, 19 deletions
diff --git a/src/modules/spaste/libkvispaste.cpp b/src/modules/spaste/libkvispaste.cpp
index 81b1a7b2e..5049167b6 100644
--- a/src/modules/spaste/libkvispaste.cpp
+++ b/src/modules/spaste/libkvispaste.cpp
@@ -206,34 +206,35 @@ static bool spaste_kvs_cmd_stop(KviKvsModuleCommandCall * c)
{
while(g_pControllerList->first()) delete g_pControllerList->first();
return true;
- } else {
- KviPointerListIterator<SPasteController> it(*g_pControllerList);
- SPasteController *item;
+ }
- if(!iId) //Delete all spaste's from the current window
+ KviPointerListIterator<SPasteController> it(*g_pControllerList);
+ SPasteController *item;
+
+ if(!iId) //Delete all spaste's from the current window
+ {
+ if((c->window()->type() != KVI_WINDOW_TYPE_CHANNEL) && (c->window()->type() != KVI_WINDOW_TYPE_QUERY) && (c->window()->type() != KVI_WINDOW_TYPE_DCCCHAT))
{
- if((c->window()->type() != KVI_WINDOW_TYPE_CHANNEL) && (c->window()->type() != KVI_WINDOW_TYPE_QUERY) && (c->window()->type() != KVI_WINDOW_TYPE_DCCCHAT))
- {
- QString szWinId = c->window()->id();
- c->warning(__tr2qs("The specified window (%Q) is not a channel/query/dcc"),&szWinId);
- return false;
- } else {
- while( (item = it.current()) != 0)
- {
- ++it;
- if(KviQString::equalCS(item->window()->id(),c->window()->id()))delete item;
- }
- }
+ QString szWinId = c->window()->id();
+ c->warning(__tr2qs("The specified window (%Q) is not a channel/query/dcc"),&szWinId);
+ return false;
} else {
- //Delete the spaste with the given id
while( (item = it.current()) != 0)
{
++it;
- if(item->getId() == iId)delete item;
+ if(KviQString::equalCS(item->window()->id(),c->window()->id()))delete item;
}
}
- return true;
+ } else {
+ //Delete the spaste with the given id
+ while( (item = it.current()) != 0)
+ {
+ ++it;
+ if(item->getId() == (kvs_int_t)iId)
+ delete item;
+ }
}
+ return true;
}
/*