Diffstat (limited to 'noncore/settings/networksettings/ppp/pppdata.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings/ppp/pppdata.cpp | 92 |
1 files changed, 46 insertions, 46 deletions
diff --git a/noncore/settings/networksettings/ppp/pppdata.cpp b/noncore/settings/networksettings/ppp/pppdata.cpp index f4727c1..567ccf8 100644 --- a/noncore/settings/networksettings/ppp/pppdata.cpp +++ b/noncore/settings/networksettings/ppp/pppdata.cpp | |||
@@ -57,6 +57,6 @@ PPPData::PPPData() | |||
57 | accountList = cfg.readListEntry(ACCOUNT_LIST, ',' ); | 57 | accountList = cfg.readListEntry(ACCOUNT_LIST, ',' ); |
58 | deviceList = cfg.readListEntry(DEVICESNAMES_LIST, ',' ); | 58 | deviceList = cfg.readListEntry(DEVICESNAMES_LIST, ',' ); |
59 | qDebug("PPPData::PPPData has a accountList %s", accountList.join("---").latin1()); | 59 | odebug << "PPPData::PPPData has a accountList " << accountList.join("---").latin1() << "" << oendl; |
60 | qDebug("PPPData::PPPData has a deviceList %s", deviceList.join("---").latin1()); | 60 | odebug << "PPPData::PPPData has a deviceList " << deviceList.join("---").latin1() << "" << oendl; |
61 | 61 | ||
62 | // if (highcount > MAX_ACCOUNTS) | 62 | // if (highcount > MAX_ACCOUNTS) |
@@ -87,5 +87,5 @@ Config PPPData::config() | |||
87 | void PPPData::save() | 87 | void PPPData::save() |
88 | { | 88 | { |
89 | qDebug("PPPData saving data"); | 89 | odebug << "PPPData saving data" << oendl; |
90 | writeConfig(GENERAL_GRP, NUMACCOUNTS_KEY, count()); | 90 | writeConfig(GENERAL_GRP, NUMACCOUNTS_KEY, count()); |
91 | writeConfig(GENERAL_GRP, NUMDEVICES_KEY, highcountdev + 1); | 91 | writeConfig(GENERAL_GRP, NUMDEVICES_KEY, highcountdev + 1); |
@@ -101,7 +101,7 @@ void PPPData::save() | |||
101 | QString val = it.data(); | 101 | QString val = it.data(); |
102 | key = it.key(); | 102 | key = it.key(); |
103 | // qDebug("saving %s -> %s", key.latin1(), val.latin1() ); | 103 | // odebug << "saving " << key.latin1() << " -> " << val.latin1() << "" << oendl; |
104 | keys = QStringList::split( "SEPARATOR", key ); | 104 | keys = QStringList::split( "SEPARATOR", key ); |
105 | //qDebug("group >%s< key >%s< value >%s<", keys[0].latin1(), keys[1].latin1(), val.latin1() ); | 105 | //odebug << "group >" << keys[0].latin1() << "< key >" << keys[1].latin1() << "< value >" << val.latin1() << "<" << oendl; |
106 | cfg.setGroup(keys[0]); | 106 | cfg.setGroup(keys[0]); |
107 | cfg.writeEntry(keys[1], val); | 107 | cfg.writeEntry(keys[1], val); |
@@ -111,7 +111,7 @@ void PPPData::save() | |||
111 | int val = it.data(); | 111 | int val = it.data(); |
112 | key = it.key(); | 112 | key = it.key(); |
113 | // qDebug("saving %s -> %i", key.latin1(), val ); | 113 | // odebug << "saving " << key.latin1() << " -> " << val << "" << oendl; |
114 | keys = QStringList::split( "SEPARATOR", key ); | 114 | keys = QStringList::split( "SEPARATOR", key ); |
115 | //qDebug("group >%s< key >%s< val %i", keys[0].latin1(), keys[1].latin1(), val ); | 115 | //odebug << "group >" << keys[0].latin1() << "< key >" << keys[1].latin1() << "< val " << val << "" << oendl; |
116 | cfg.setGroup(keys[0]); | 116 | cfg.setGroup(keys[0]); |
117 | cfg.writeEntry(keys[1], val); | 117 | cfg.writeEntry(keys[1], val); |
@@ -122,5 +122,5 @@ void PPPData::save() | |||
122 | key = it.key(); | 122 | key = it.key(); |
123 | QChar sep = sepEntries[key]; | 123 | QChar sep = sepEntries[key]; |
124 | // qDebug("saving %s -> %s", key.latin1(), val.join(sep).latin1() ); | 124 | // odebug << "saving " << key.latin1() << " -> " << val.join(sep).latin1() << "" << oendl; |
125 | keys = QStringList::split( "SEPARATOR", key ); | 125 | keys = QStringList::split( "SEPARATOR", key ); |
126 | cfg.setGroup(keys[0]); | 126 | cfg.setGroup(keys[0]); |
@@ -143,5 +143,5 @@ QString PPPData::readConfig(const QString &group, const QString &key, | |||
143 | const QString &defvalue = "") | 143 | const QString &defvalue = "") |
144 | { | 144 | { |
145 | // qDebug("PPPData::readConfig key >%s< group >%s<",key.latin1(), group.latin1()); | 145 | // odebug << "PPPData::readConfig key >" << key.latin1() << "< group >" << group.latin1() << "<" << oendl; |
146 | QString idx = SEP.arg(group).arg(key); | 146 | QString idx = SEP.arg(group).arg(key); |
147 | if (stringEntries.find(idx) != stringEntries.end()) | 147 | if (stringEntries.find(idx) != stringEntries.end()) |
@@ -366,5 +366,5 @@ const QString PPPData::modemDevice() { | |||
366 | 366 | ||
367 | // bool PPPData::setModemName(const QString &n) { | 367 | // bool PPPData::setModemName(const QString &n) { |
368 | // qDebug("Setting modem name to >%s<", n.latin1()); | 368 | // odebug << "Setting modem name to >" << n.latin1() << "<" << oendl; |
369 | // _modemName = n; | 369 | // _modemName = n; |
370 | // writeConfig(cgroup, MODEMNAME_KEY, n); | 370 | // writeConfig(cgroup, MODEMNAME_KEY, n); |
@@ -373,5 +373,5 @@ const QString PPPData::modemDevice() { | |||
373 | 373 | ||
374 | // bool PPPData::changeModemName(const QString &n) { | 374 | // bool PPPData::changeModemName(const QString &n) { |
375 | // qDebug("Setting modem name to >%s<", n.latin1()); | 375 | // odebug << "Setting modem name to >" << n.latin1() << "<" << oendl; |
376 | // _modemName = n; | 376 | // _modemName = n; |
377 | // writeConfig(modemGroup(), MODEMNAME_KEY, n); | 377 | // writeConfig(modemGroup(), MODEMNAME_KEY, n); |
@@ -380,5 +380,5 @@ const QString PPPData::modemDevice() { | |||
380 | 380 | ||
381 | bool PPPData::setModemDevice(const QString &n) { | 381 | bool PPPData::setModemDevice(const QString &n) { |
382 | qDebug("Setting modem dev to >%s<", n.latin1()); | 382 | odebug << "Setting modem dev to >" << n.latin1() << "<" << oendl; |
383 | writeConfig(modemGroup(), MODEMDEV_KEY, n); | 383 | writeConfig(modemGroup(), MODEMDEV_KEY, n); |
384 | return true; //FIXME | 384 | return true; //FIXME |
@@ -740,16 +740,16 @@ int PPPData::count() const { | |||
740 | 740 | ||
741 | bool PPPData::setAccount(const QString &aname) { | 741 | bool PPPData::setAccount(const QString &aname) { |
742 | qDebug("setting account to >%s<", aname.latin1()); | 742 | odebug << "setting account to >" << aname.latin1() << "<" << oendl; |
743 | for ( QStringList::Iterator it = accountList.begin(); it != accountList.end(); ++it ) { | 743 | for ( QStringList::Iterator it = accountList.begin(); it != accountList.end(); ++it ) { |
744 | cgroup = *it; | 744 | cgroup = *it; |
745 | qDebug("PPPData::setAccount %s", cgroup.latin1()); | 745 | odebug << "PPPData::setAccount " << cgroup.latin1() << "" << oendl; |
746 | qDebug( "iterator %s", (*it).latin1() ); | 746 | odebug << "iterator " << (*it).latin1() << "" << oendl; |
747 | if(accname() == aname) { | 747 | if(accname() == aname) { |
748 | qDebug("SUCCESS"); | 748 | odebug << "SUCCESS" << oendl; |
749 | return true; | 749 | return true; |
750 | } | 750 | } |
751 | 751 | ||
752 | } | 752 | } |
753 | qDebug("FAILURE"); | 753 | odebug << "FAILURE" << oendl; |
754 | return false; | 754 | return false; |
755 | } | 755 | } |
@@ -773,9 +773,9 @@ bool PPPData::isUniqueAccname(const QString &n) { | |||
773 | for ( QStringList::Iterator it = accountList.begin(); it != accountList.end(); ++it ) { | 773 | for ( QStringList::Iterator it = accountList.begin(); it != accountList.end(); ++it ) { |
774 | cgroup = *it; | 774 | cgroup = *it; |
775 | qDebug("PPPData::setAccount %s", cgroup.latin1()); | 775 | odebug << "PPPData::setAccount " << cgroup.latin1() << "" << oendl; |
776 | qDebug( "%s \n", (*it).latin1() ); | 776 | odebug << "" << (*it).latin1() << " \n" << oendl; |
777 | if(accname() == n && cgroup != save_cgroup) { | 777 | if(accname() == n && cgroup != save_cgroup) { |
778 | cgroup = save_cgroup; | 778 | cgroup = save_cgroup; |
779 | qDebug("SUCCESS"); | 779 | odebug << "SUCCESS" << oendl; |
780 | return false; | 780 | return false; |
781 | } | 781 | } |
@@ -789,11 +789,11 @@ bool PPPData::isUniqueAccname(const QString &n) { | |||
789 | bool PPPData::isUniqueDevname(const QString &n) { | 789 | bool PPPData::isUniqueDevname(const QString &n) { |
790 | QString save_mName = _modemName; | 790 | QString save_mName = _modemName; |
791 | qDebug("PPPData::isUniqueDevname checking if %s is unique", n.latin1()); | 791 | odebug << "PPPData::isUniqueDevname checking if " << n.latin1() << " is unique" << oendl; |
792 | for ( QStringList::Iterator it = deviceList.begin(); it != deviceList.end(); ++it ) { | 792 | for ( QStringList::Iterator it = deviceList.begin(); it != deviceList.end(); ++it ) { |
793 | _modemName = *it; | 793 | _modemName = *it; |
794 | qDebug("PPPData::isUniqueDevname %s == %s", n.latin1() , devname().latin1()); | 794 | odebug << "PPPData::isUniqueDevname " << n.latin1() << " == " << devname().latin1() << "" << oendl; |
795 | if(devname() == n && _modemName != save_mName) { | 795 | if(devname() == n && _modemName != save_mName) { |
796 | _modemName = save_mName; | 796 | _modemName = save_mName; |
797 | qDebug("NOT UNIQUE"); | 797 | odebug << "NOT UNIQUE" << oendl; |
798 | return false; | 798 | return false; |
799 | } | 799 | } |
@@ -821,5 +821,5 @@ bool PPPData::deleteAccount() { | |||
821 | if(keys[0]==cgroup){ | 821 | if(keys[0]==cgroup){ |
822 | stringEntries.remove( it ); | 822 | stringEntries.remove( it ); |
823 | qDebug("deleting >%s< key >%s< value >%s<", keys[0].latin1(), keys[1].latin1(), val.latin1() ); | 823 | odebug << "deleting >" << keys[0].latin1() << "< key >" << keys[1].latin1() << "< value >" << val.latin1() << "<" << oendl; |
824 | } | 824 | } |
825 | } | 825 | } |
@@ -831,5 +831,5 @@ bool PPPData::deleteAccount() { | |||
831 | if(keys[0]==cgroup){ | 831 | if(keys[0]==cgroup){ |
832 | intEntries.remove( it ); | 832 | intEntries.remove( it ); |
833 | qDebug("deleting >%s< key >%s< value >%i<", keys[0].latin1(), keys[1].latin1(), val ); | 833 | odebug << "deleting >" << keys[0].latin1() << "< key >" << keys[1].latin1() << "< value >" << val << "<" << oendl; |
834 | } | 834 | } |
835 | } | 835 | } |
@@ -841,5 +841,5 @@ bool PPPData::deleteAccount() { | |||
841 | listEntries.remove( it ); | 841 | listEntries.remove( it ); |
842 | sepEntries.remove( key ); | 842 | sepEntries.remove( key ); |
843 | qDebug("deleting >%s< key >%s< value >%s<", keys[0].latin1(), keys[1].latin1(), val.join("").latin1() ); | 843 | odebug << "deleting >" << keys[0].latin1() << "< key >" << keys[1].latin1() << "< value >" << val.join("").latin1() << "<" << oendl; |
844 | } | 844 | } |
845 | } | 845 | } |
@@ -861,5 +861,5 @@ bool PPPData::deleteAccount(const QString &aname) { | |||
861 | int PPPData::newaccount() { | 861 | int PPPData::newaccount() { |
862 | 862 | ||
863 | qDebug("PPPData::newaccount highcount %i/%i",highcount,MAX_ACCOUNTS); | 863 | odebug << "PPPData::newaccount highcount " << highcount << "/" << MAX_ACCOUNTS << "" << oendl; |
864 | // if(!config) open(); | 864 | // if(!config) open(); |
865 | // if (highcount >= MAX_ACCOUNTS) return -1; | 865 | // if (highcount >= MAX_ACCOUNTS) return -1; |
@@ -870,5 +870,5 @@ int PPPData::newaccount() { | |||
870 | cgroup = QString(tmp); | 870 | cgroup = QString(tmp); |
871 | accountList << tmp; | 871 | accountList << tmp; |
872 | qDebug("PPPData::newaccount() Group: >%s<",cgroup.latin1()); | 872 | odebug << "PPPData::newaccount() Group: >" << cgroup.latin1() << "<" << oendl; |
873 | setpppdArgumentDefaults(); | 873 | setpppdArgumentDefaults(); |
874 | return highcount; | 874 | return highcount; |
@@ -966,7 +966,7 @@ void PPPData::setStoredUsername(const QString &b) { | |||
966 | 966 | ||
967 | const QString PPPData::storedPassword() { | 967 | const QString PPPData::storedPassword() { |
968 | qDebug("getting stored pw"); | 968 | odebug << "getting stored pw" << oendl; |
969 | qDebug("g %s", cgroup.latin1() ); | 969 | odebug << "g " << cgroup.latin1() << "" << oendl; |
970 | qDebug("k %s", STORED_PASSWORD_KEY); | 970 | odebug << "k " << STORED_PASSWORD_KEY << "" << oendl; |
971 | return readConfig(cgroup, STORED_PASSWORD_KEY, ""); | 971 | return readConfig(cgroup, STORED_PASSWORD_KEY, ""); |
972 | } | 972 | } |
@@ -1330,8 +1330,8 @@ void PPPData::setConfiguredInterfaces( QMap<QString,QString> ifaces ) | |||
1330 | cfg.writeEntry( ACOUNTS_DEV, it.key() ); | 1330 | cfg.writeEntry( ACOUNTS_DEV, it.key() ); |
1331 | cfg.writeEntry( ACOUNTS_ACC, it.data() ); | 1331 | cfg.writeEntry( ACOUNTS_ACC, it.data() ); |
1332 | qDebug("I %i",i); | 1332 | odebug << "I " << i << "" << oendl; |
1333 | } | 1333 | } |
1334 | cfg.setGroup( ACCLIST_GRP ); | 1334 | cfg.setGroup( ACCLIST_GRP ); |
1335 | qDebug("saved %i account settings", i); | 1335 | odebug << "saved " << i << " account settings" << oendl; |
1336 | cfg.writeEntry( ACCOUNTS_COUNT, i ); | 1336 | cfg.writeEntry( ACCOUNTS_COUNT, i ); |
1337 | 1337 | ||
@@ -1373,5 +1373,5 @@ const QString PPPData::devname() | |||
1373 | { | 1373 | { |
1374 | QString tmp = readConfig(modemGroup(), MODEMNAME_KEY ); | 1374 | QString tmp = readConfig(modemGroup(), MODEMNAME_KEY ); |
1375 | qDebug("PPPData::devname() of %s is %s", modemGroup().latin1(), tmp.latin1()); | 1375 | odebug << "PPPData::devname() of " << modemGroup().latin1() << " is " << tmp.latin1() << "" << oendl; |
1376 | return tmp; | 1376 | return tmp; |
1377 | } | 1377 | } |
@@ -1391,12 +1391,12 @@ void PPPData::setDevname(const QString &n) { | |||
1391 | bool PPPData::setDevice(const QString &dev ) | 1391 | bool PPPData::setDevice(const QString &dev ) |
1392 | { | 1392 | { |
1393 | qDebug("setting device to >%s<", dev.latin1()); | 1393 | odebug << "setting device to >" << dev.latin1() << "<" << oendl; |
1394 | QString save_mName = _modemName; | 1394 | QString save_mName = _modemName; |
1395 | for ( QStringList::Iterator it = deviceList.begin(); it != deviceList.end(); ++it ) { | 1395 | for ( QStringList::Iterator it = deviceList.begin(); it != deviceList.end(); ++it ) { |
1396 | _modemName = *it; | 1396 | _modemName = *it; |
1397 | qDebug("PPPData::setDevice %s is named %s", _modemName.latin1(), devname().latin1() ); | 1397 | odebug << "PPPData::setDevice " << _modemName.latin1() << " is named " << devname().latin1() << "" << oendl; |
1398 | qDebug( "iterator %s", (*it).latin1() ); | 1398 | odebug << "iterator " << (*it).latin1() << "" << oendl; |
1399 | if(devname() == dev) { | 1399 | if(devname() == dev) { |
1400 | qDebug("SUCCESS"); | 1400 | odebug << "SUCCESS" << oendl; |
1401 | return true; | 1401 | return true; |
1402 | } | 1402 | } |
@@ -1404,5 +1404,5 @@ bool PPPData::setDevice(const QString &dev ) | |||
1404 | } | 1404 | } |
1405 | _modemName = save_mName; | 1405 | _modemName = save_mName; |
1406 | qDebug("FAILURE"); | 1406 | odebug << "FAILURE" << oendl; |
1407 | return false; | 1407 | return false; |
1408 | } | 1408 | } |
@@ -1425,5 +1425,5 @@ bool PPPData::deleteDevice() | |||
1425 | if(keys[0]==modemGroup()){ | 1425 | if(keys[0]==modemGroup()){ |
1426 | stringEntries.remove( it ); | 1426 | stringEntries.remove( it ); |
1427 | qDebug("deleting >%s< key >%s< value >%s<", keys[0].latin1(), keys[1].latin1(), val.latin1() ); | 1427 | odebug << "deleting >" << keys[0].latin1() << "< key >" << keys[1].latin1() << "< value >" << val.latin1() << "<" << oendl; |
1428 | } | 1428 | } |
1429 | } | 1429 | } |
@@ -1435,5 +1435,5 @@ bool PPPData::deleteDevice() | |||
1435 | if(keys[0]==modemGroup()){ | 1435 | if(keys[0]==modemGroup()){ |
1436 | intEntries.remove( it ); | 1436 | intEntries.remove( it ); |
1437 | qDebug("deleting >%s< key >%s< value >%i<", keys[0].latin1(), keys[1].latin1(), val ); | 1437 | odebug << "deleting >" << keys[0].latin1() << "< key >" << keys[1].latin1() << "< value >" << val << "<" << oendl; |
1438 | } | 1438 | } |
1439 | } | 1439 | } |
@@ -1445,5 +1445,5 @@ bool PPPData::deleteDevice() | |||
1445 | listEntries.remove( it ); | 1445 | listEntries.remove( it ); |
1446 | sepEntries.remove( key ); | 1446 | sepEntries.remove( key ); |
1447 | qDebug("deleting >%s< key >%s< value >%s<", keys[0].latin1(), keys[1].latin1(), val.join("").latin1() ); | 1447 | odebug << "deleting >" << keys[0].latin1() << "< key >" << keys[1].latin1() << "< value >" << val.join("").latin1() << "<" << oendl; |
1448 | } | 1448 | } |
1449 | } | 1449 | } |
@@ -1464,5 +1464,5 @@ int PPPData::newdevice() | |||
1464 | { | 1464 | { |
1465 | 1465 | ||
1466 | qDebug("PPPData::newdevice highcount %i",highcountdev); | 1466 | odebug << "PPPData::newdevice highcount " << highcountdev << "" << oendl; |
1467 | 1467 | ||
1468 | 1468 | ||
@@ -1471,5 +1471,5 @@ int PPPData::newdevice() | |||
1471 | _modemName = QString(tmp); | 1471 | _modemName = QString(tmp); |
1472 | deviceList << tmp; | 1472 | deviceList << tmp; |
1473 | qDebug("PPPData::newdevice() Group: >%s<",cgroup.latin1()); | 1473 | odebug << "PPPData::newdevice() Group: >" << cgroup.latin1() << "<" << oendl; |
1474 | return highcountdev; | 1474 | return highcountdev; |
1475 | } | 1475 | } |
@@ -1485,8 +1485,8 @@ QStringList PPPData::getDevicesNamesList() | |||
1485 | QStringList list; | 1485 | QStringList list; |
1486 | QString save_mName = _modemName; | 1486 | QString save_mName = _modemName; |
1487 | qDebug("PPPData::getDevicesNamesList has %s", deviceList.join("---").latin1()); | 1487 | odebug << "PPPData::getDevicesNamesList has " << deviceList.join("---").latin1() << "" << oendl; |
1488 | for ( QStringList::Iterator it = deviceList.begin(); it != deviceList.end(); ++it ) { | 1488 | for ( QStringList::Iterator it = deviceList.begin(); it != deviceList.end(); ++it ) { |
1489 | _modemName = *it; | 1489 | _modemName = *it; |
1490 | qDebug("PPPData::getDevicesNamesList adding %s as %s",_modemName.latin1(), devname().latin1()); | 1490 | odebug << "PPPData::getDevicesNamesList adding " << _modemName.latin1() << " as " << devname().latin1() << "" << oendl; |
1491 | list << devname(); | 1491 | list << devname(); |
1492 | } | 1492 | } |