aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar Szymon Tomasz Stefanek2015-08-30 23:07:23 +0200
committerGravatar Szymon Tomasz Stefanek2015-08-30 23:07:23 +0200
commit567b8b940cc6eb4256825e4ffae7649b7e218ea9 (patch)
tree29d036269d0d0cc311d2194d8ad4342de137a274 /src
parentMerge branch 'master' of https://github.com/kvirc/KVIrc (diff)
downloadKVIrc-567b8b940cc6eb4256825e4ffae7649b7e218ea9.tar.gz
KVIrc-567b8b940cc6eb4256825e4ffae7649b7e218ea9.tar.bz2
KVIrc-567b8b940cc6eb4256825e4ffae7649b7e218ea9.zip
Fix item parent-child relationship in channelsjoin dialog
Diffstat (limited to 'src')
-rw-r--r--src/modules/channelsjoin/ChannelsJoinDialog.cpp22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/modules/channelsjoin/ChannelsJoinDialog.cpp b/src/modules/channelsjoin/ChannelsJoinDialog.cpp
index ace796f4f..492efea4a 100644
--- a/src/modules/channelsjoin/ChannelsJoinDialog.cpp
+++ b/src/modules/channelsjoin/ChannelsJoinDialog.cpp
@@ -197,6 +197,8 @@ void ChannelsJoinDialog::fillListView()
bool bGotChanOnCurrentNetwork = false;
+ QTreeWidgetItem * hdr;
+
if(m_pConsole)
{
QStringList * pList = g_pApp->recentChannelsForNetwork(m_pConsole->currentNetworkName());
@@ -206,17 +208,17 @@ void ChannelsJoinDialog::fillListView()
{
bGotChanOnCurrentNetwork = true;
- par = new QTreeWidgetItem(par, HeaderItem);
- par->setText(0,__tr2qs("Current Network"));
- par->setExpanded(true);
+ hdr = new QTreeWidgetItem(par, HeaderItem);
+ hdr->setText(0,__tr2qs("Current Network"));
+ hdr->setExpanded(true);
for(QStringList::Iterator it = pList->begin(); it != pList->end(); ++it)
{
- chld = new QTreeWidgetItem(par, RecentChannelItem);
+ chld = new QTreeWidgetItem(hdr, RecentChannelItem);
chld->setText(0,*it);
chld->setIcon(0,*(g_pIconManager->getSmallIcon(KviIconManager::Channel)));
}
- par->sortChildren(0, Qt::AscendingOrder);
+ hdr->sortChildren(0, Qt::AscendingOrder);
}
}
}
@@ -225,11 +227,11 @@ void ChannelsJoinDialog::fillListView()
if(!pDict)
return;
- par = new QTreeWidgetItem(par, HeaderItem);
- par->setText(0,__tr2qs("All Networks"));
+ hdr = new QTreeWidgetItem(par, HeaderItem);
+ hdr->setText(0,__tr2qs("All Networks"));
if(!bGotChanOnCurrentNetwork)
- par->setExpanded(true); // expand this one instead
+ hdr->setExpanded(true); // expand this one instead
QHash<QString,int> hNoDuplicates;
@@ -241,12 +243,12 @@ void ChannelsJoinDialog::fillListView()
if(hNoDuplicates.contains(chan.toLower()))
continue;
hNoDuplicates.insert(chan.toLower(),1);
- chld = new QTreeWidgetItem(par, RecentChannelItem);
+ chld = new QTreeWidgetItem(hdr, RecentChannelItem);
chld->setText(0,chan);
chld->setIcon(0,*(g_pIconManager->getSmallIcon(KviIconManager::Channel)));
}
}
- par->sortChildren(0, Qt::AscendingOrder);
+ hdr->sortChildren(0, Qt::AscendingOrder);
}
void ChannelsJoinDialogTreeWidget::mousePressEvent(QMouseEvent *e)