[Kmyirc-cvs] kmyirc-ng/src Makefile.in,1.12,1.13 kmiircservercfg.cpp,1.8,1.9 kmiircservercfg.h,1.3,1
Status: Alpha
Brought to you by:
shermann
|
From: <she...@us...> - 2003-05-02 14:57:34
|
Update of /cvsroot/kmyirc/kmyirc-ng/src
In directory sc8-pr-cvs1:/tmp/cvs-serv2430/src
Modified Files:
Makefile.in kmiircservercfg.cpp kmiircservercfg.h
Log Message:
changed some things
Index: Makefile.in
===================================================================
RCS file: /cvsroot/kmyirc/kmyirc-ng/src/Makefile.in,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
Index: kmiircservercfg.cpp
===================================================================
RCS file: /cvsroot/kmyirc/kmyirc-ng/src/kmiircservercfg.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- kmiircservercfg.cpp 2 May 2003 09:48:55 -0000 1.8
+++ kmiircservercfg.cpp 2 May 2003 14:57:29 -0000 1.9
@@ -186,7 +186,7 @@
}
if (dlg->exec()) {
// Set group in KGlobal::config()
- KGlobal::config()->setGroup("Group :"+lv_ircServerList->currentItem()->parent()->text(0));
+ KGlobal::config()->setGroup("Group: "+lv_ircServerList->currentItem()->parent()->text(0));
// Getting old server entry
QString oldServer=lv_ircServerList->currentItem()->text(1);
@@ -209,7 +209,7 @@
lv_ircServerList->currentItem()->setText(3,temp);
// Generating new server entry in current server group in KGlobal::config()
- KGlobal::config()->writeEntry(dlg->serverName(),QString("%1").arg(dlg->port())+";"+temp+";\""+dlg->description()+"\"");
+ KGlobal::config()->writeEntry(dlg->serverName(),QString("%1").arg(dlg->port())+";"+temp+";"+lv_ircServerList->currentItem()->text(4)+";\""+dlg->description()+"\"");
// Changing avatar server entry to new avatar server entry
KGlobal::config()->setGroup("Server: "+oldServer+":"+oldPort);
KGlobal::config()->writeEntry("IRCNickname",KGlobal::config()->readEntry("IRCNickname",""));
@@ -340,7 +340,7 @@
// Split values from key
// ParseServerEntry(it1.data());
- parseServerEntry(it1.data());
+ parseServerEntry(item1,it1.data());
}
}
@@ -350,30 +350,34 @@
/*!
\fn KMIIRCServerCfg::parseServerEntry(const QString &)
*/
-void KMIIRCServerCfg::parseServerEntry(const QString &value)
+void KMIIRCServerCfg::parseServerEntry(KListViewItem *item, const QString &value)
{
#ifdef DEBUG
qWarning("Entering KMIIRCServerCfg::parseServerEntry()\n");
#endif
QString temp=value;
- QStringList lst;
- lst.append(temp.left(temp.find(";")));
+
+ //
+ // Strip tokens (not using section or qstringlist::split because of the description, when this contains a ";" we have
+ // problems, easier to do it by hand
+ //
+
+ QString port=(temp.left(temp.find(";")));
temp.remove(0,temp.find(";")+1);
- qWarning("temp: "+temp+"\n");
- lst.append(temp.left(temp.find(";")));
+ QString ssl=temp.left(temp.find(";"));
temp.remove(0,temp.find(";")+1);
- lst.append(temp.left(temp.find(";")));
+ QString avatar=temp.left(temp.find(";"));
temp.remove(0,temp.find(";")+1);
temp.remove(0,1);
temp.remove(temp.length()-1,1);
- lst.append(temp);
-
+ QString description=temp;
+ // Insert into listview under group item
+ item->setText(2,port);
+ item->setText(3,i18n(ssl));
+ item->setText(4,i18n(avatar));
+ item->setText(5,description);
+ item->setMultiLinesEnabled(true);
-#ifdef DEBUG
- for (QStringList::Iterator it=lst.begin();it!=lst.end();++it) {
- qWarning("KMIIRCServerCfg::parseServerEntry(): Entry: "+*it+"\n");
- }
-#endif
}
Index: kmiircservercfg.h
===================================================================
RCS file: /cvsroot/kmyirc/kmyirc-ng/src/kmiircservercfg.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- kmiircservercfg.h 2 May 2003 09:48:55 -0000 1.3
+++ kmiircservercfg.h 2 May 2003 14:57:29 -0000 1.4
@@ -4,6 +4,8 @@
#include "ircservercfg.h"
+class KListViewItem;
+
class KMIIRCServerCfg : public IrcServerCfg
{
@@ -35,7 +37,7 @@
public: void loadSettings();
- private: void parseServerEntry(const QString &);
+ private: void parseServerEntry(KListViewItem *,const QString &);
};
#endif
|