1
/* This file is part of the KDE project
2
Copyright (C) 2006 Kevin Ottens <ervin@kde.org>
4
This library is free software; you can redistribute it and/or
5
modify it under the terms of the GNU Library General Public
6
License version 2 as published by the Free Software Foundation.
8
This library is distributed in the hope that it will be useful,
9
but WITHOUT ANY WARRANTY; without even the implied warranty of
10
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
Library General Public License for more details.
13
You should have received a copy of the GNU Library General Public License
14
along with this library; see the file COPYING.LIB. If not, write to
15
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16
Boston, MA 02110-1301, USA.
20
#include "solid-network.h"
24
#include <QStringList>
25
#include <QMetaProperty>
29
#include <kcomponentdata.h>
30
#include <kcmdlineargs.h>
34
#include <solid/device.h>
35
#include <solid/genericinterface.h>
36
#include <solid/storageaccess.h>
37
#include <solid/opticaldrive.h>
39
#include <solid/control/ifaces/authentication.h>
40
#include <solid/control/networkmanager.h>
41
#include <solid/control/networkinterface.h>
42
#include <solid/control/wirednetworkinterface.h>
43
#include <solid/control/wirelessnetworkinterface.h>
44
#include <solid/control/wirelessaccesspoint.h>
52
static const char appName[] = "solid-network";
53
static const char programName[] = I18N_NOOP("solid-network");
55
static const char description[] = I18N_NOOP("KDE tool for querying and controlling your network interfaces from the command line");
57
static const char version[] = "0.1";
59
std::ostream &operator<<(std::ostream &out, const QString &msg)
61
return (out << msg.toLocal8Bit().constData());
64
std::ostream &operator<<(std::ostream &out, const QVariant &value)
68
case QVariant::StringList:
72
QStringList list = value.toStringList();
74
QStringList::ConstIterator it = list.constBegin();
75
QStringList::ConstIterator end = list.constEnd();
79
out << "'" << *it << "'";
87
out << "} (string list)";
91
out << (value.toBool()?"true":"false") << " (bool)";
94
out << value.toString()
95
<< " (0x" << QString::number(value.toInt(), 16) << ") (int)";
98
out << "'" << value.toString() << "' (string)";
105
std::ostream &operator<<(std::ostream &out, const Solid::Device &device)
107
out << " parent = " << QVariant(device.parentUdi()) << endl;
108
out << " vendor = " << QVariant(device.vendor()) << endl;
109
out << " product = " << QVariant(device.product()) << endl;
111
int index = Solid::DeviceInterface::staticMetaObject.indexOfEnumerator("Type");
112
QMetaEnum typeEnum = Solid::DeviceInterface::staticMetaObject.enumerator(index);
114
for (int i=0; i<typeEnum.keyCount(); i++)
116
Solid::DeviceInterface::Type type = (Solid::DeviceInterface::Type)typeEnum.value(i);
117
const Solid::DeviceInterface *interface = device.asDeviceInterface(type);
121
const QMetaObject *meta = interface->metaObject();
123
for (int i=meta->propertyOffset(); i<meta->propertyCount(); i++)
125
QMetaProperty property = meta->property(i);
126
out << " " << QString(meta->className()).mid(7) << "." << property.name()
129
QVariant value = property.read(interface);
131
if (property.isEnumType()) {
132
QMetaEnum metaEnum = property.enumerator();
133
out << "'" << metaEnum.valueToKeys(value.toInt()).constData() << "'"
134
<< " (0x" << QString::number(value.toInt(), 16) << ") ";
135
if (metaEnum.isFlag()) {
142
out << value << endl;
151
std::ostream &operator<<(std::ostream &out, const QMap<QString,QVariant> &properties)
153
QMap<QString, QVariant>::ConstIterator it = properties.constBegin(), itEnd = properties.constEnd();
154
for ( ; it != itEnd; ++it)
156
out << " " << it.key() << " = " << it.value() << endl;
162
std::ostream &operator<<(std::ostream &out, const Solid::Control::NetworkInterface &networkdevice)
164
out << " UNI = " << QVariant(networkdevice.uni()) << endl;
165
out << " Type = " << (networkdevice.type() == Solid::Control::NetworkInterface::Ieee8023 ? "Wired" : "802.11 Wireless") << endl;
166
out << " Active = " << (networkdevice.isActive() ? "Yes" : "No") << endl;
167
out << " Interface Name = " << networkdevice.interfaceName() << endl;
168
out << " Driver = " << networkdevice.driver() << endl;
169
//out << " HW Address = " << networkdevice. // TODO add to solid API.
170
out << "\n Capabilities:" << endl;
171
out << " Supported = " << (networkdevice.capabilities() & Solid::Control::NetworkInterface::IsManageable ? "Yes" : "No") << endl;
172
out << " Speed = " << networkdevice.designSpeed() << endl;
174
if (networkdevice.type() == Solid::Control::NetworkInterface::Ieee8023) {
176
out << " Carrier Detect = " << (networkdevice.capabilities() & Solid::Control::NetworkInterface::SupportsCarrierDetect ? "Yes" : "No") << endl;
179
out << " Wireless Scan = " << (networkdevice.capabilities() & Solid::Control::NetworkInterface::SupportsWirelessScan ? "Yes" : "No") << endl;
181
out << " Link Up = " << (networkdevice.isLinkUp() ? "Yes" : "No") << endl;
187
std::ostream &operator<<(std::ostream &out, const Solid::Control::AccessPoint &ap)
189
out << " UNI = " << QVariant(ap.uni()) << endl;
190
out << " SSID = " << QVariant(ap.ssid()) << endl;
191
out << " MAC Address = " << QVariant(ap.hardwareAddress()) << endl;
192
out << " Frequency (MHz) = " << ap.frequency() << endl;
193
out << " Max BitRate (Kb/s) = " << ap.maxBitRate() << endl;
194
out << " Signal Strength = " << ap.signalStrength() << endl;
198
case Solid::Control::WirelessNetworkInterface::Unassociated:
199
cout << "Unassociated" << endl;
201
case Solid::Control::WirelessNetworkInterface::Adhoc:
202
cout << "Ad-hoc" << endl;
204
case Solid::Control::WirelessNetworkInterface::Managed:
205
cout << "Infrastructure" << endl;
207
case Solid::Control::WirelessNetworkInterface::Master:
208
cout << "Master" << endl;
210
case Solid::Control::WirelessNetworkInterface::Repeater:
211
cout << "Repeater" << endl;
214
cout << "Unknown" << endl;
215
cerr << "Unknown network operation mode: " << ap.mode() << endl;
218
out << " Capabilities = ";
219
const Solid::Control::AccessPoint::Capabilities cap = ap.capabilities();
222
if (cap & Solid::Control::AccessPoint::Privacy)
228
out << "(No Capabilities)" << endl;
230
out << " WPA Options = ";
231
const Solid::Control::AccessPoint::WpaFlags wpaFlags = ap.wpaFlags();
234
if (wpaFlags & Solid::Control::AccessPoint::PairWep40)
236
if (wpaFlags & Solid::Control::AccessPoint::PairWep104)
237
out << "PairWep104,";
238
if (wpaFlags & Solid::Control::AccessPoint::PairTkip)
240
if (wpaFlags & Solid::Control::AccessPoint::PairCcmp)
242
if (wpaFlags & Solid::Control::AccessPoint::GroupWep40)
243
out << "GroupWep40,";
244
if (wpaFlags & Solid::Control::AccessPoint::GroupWep104)
245
out << "GroupWep104,";
246
if (wpaFlags & Solid::Control::AccessPoint::GroupTkip)
248
if (wpaFlags & Solid::Control::AccessPoint::GroupCcmp)
250
if (wpaFlags & Solid::Control::AccessPoint::KeyMgmtPsk)
251
out << "KeyMgmtPsk,";
252
if (wpaFlags & Solid::Control::AccessPoint::KeyMgmt8021x)
253
out << "KeyMgmt8021x,";
258
out << "(No Options)" << endl;
260
out << " RSN Options = ";
261
const Solid::Control::AccessPoint::WpaFlags rsnFlags = ap.rsnFlags();
264
if (rsnFlags & Solid::Control::AccessPoint::PairWep40)
266
if (rsnFlags & Solid::Control::AccessPoint::PairWep104)
267
out << "PairWep104,";
268
if (rsnFlags & Solid::Control::AccessPoint::PairTkip)
270
if (rsnFlags & Solid::Control::AccessPoint::PairCcmp)
272
if (rsnFlags & Solid::Control::AccessPoint::GroupWep40)
273
out << "GroupWep40,";
274
if (rsnFlags & Solid::Control::AccessPoint::GroupWep104)
275
out << "GroupWep104,";
276
if (rsnFlags & Solid::Control::AccessPoint::GroupTkip)
278
if (rsnFlags & Solid::Control::AccessPoint::GroupCcmp)
280
if (rsnFlags & Solid::Control::AccessPoint::KeyMgmtPsk)
281
out << "KeyMgmtPsk,";
282
if (rsnFlags & Solid::Control::AccessPoint::KeyMgmt8021x)
283
out << "KeyMgmt8021x,";
288
out << "(No Options)" << endl;
293
std::ostream &operator<<(std::ostream &out, const Solid::Control::WirelessNetworkInterface &network)
295
out << static_cast<const Solid::Control::NetworkInterface&>(network);
298
switch (network.mode())
300
case Solid::Control::WirelessNetworkInterface::Unassociated:
301
cout << "Unassociated" << endl;
303
case Solid::Control::WirelessNetworkInterface::Adhoc:
304
cout << "Ad-hoc" << endl;
306
case Solid::Control::WirelessNetworkInterface::Managed:
307
cout << "Infrastructure" << endl;
309
case Solid::Control::WirelessNetworkInterface::Master:
310
cout << "Master" << endl;
312
case Solid::Control::WirelessNetworkInterface::Repeater:
313
cout << "Repeater" << endl;
316
cout << "Unknown" << endl;
317
cerr << "Unknown network operation mode: " << network.mode() << endl;
320
out << " Bit Rate = " << network.bitRate() << endl;
321
out << " Hardware Address = " << network.hardwareAddress() << endl;
322
out << " Active Access Point= " << qVariantFromValue(network.activeAccessPoint()) << endl;
323
out << " Capabilities = ";
324
const Solid::Control::WirelessNetworkInterface::Capabilities cap = network.wirelessCapabilities();
327
if (cap & Solid::Control::WirelessNetworkInterface::Wpa)
329
if (cap & Solid::Control::WirelessNetworkInterface::Wep40)
331
if (cap & Solid::Control::WirelessNetworkInterface::Wep104)
333
if (cap & Solid::Control::WirelessNetworkInterface::Tkip)
335
if (cap & Solid::Control::WirelessNetworkInterface::Ccmp)
337
if (cap & Solid::Control::WirelessNetworkInterface::Rsn)
343
out << "(No Capabilities)" << endl;
348
std::ostream &operator<<(std::ostream &out, const Solid::Control::WiredNetworkInterface &network)
350
out << static_cast<const Solid::Control::NetworkInterface&>(network);
352
out << " Hardware Address = " << network.hardwareAddress() << endl;
353
out << " Bit Rate = " << network.bitRate() << endl;
354
out << " Carrier = " << qVariantFromValue(network.carrier()) << endl;
359
void checkArgumentCount(int min, int max)
361
int count = KCmdLineArgs::parsedArgs()->count();
365
cerr << i18n("Syntax Error: Not enough arguments") << endl;
369
if ((max > 0) && (count > max))
371
cerr << i18n("Syntax Error: Too many arguments") << endl;
376
int main(int argc, char **argv)
378
KCmdLineArgs::init(argc, argv, appName, 0, ki18n(programName), version, ki18n(description), KCmdLineArgs::CmdLineArgNone);
381
KCmdLineOptions options;
383
options.add("commands", ki18n("Show available commands by domains"));
385
options.add("+command", ki18n("Command (see --commands)"));
387
options.add("+[arg(s)]", ki18n("Arguments for command"));
389
KCmdLineArgs::addCmdLineOptions(options);
391
KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
393
KComponentData componentData(appName);
395
if (args->isSet("commands"))
397
KCmdLineArgs::enable_i18n();
399
cout << endl << i18n("Syntax:") << endl << endl;
401
cout << " solid-network listdevices" << endl;
402
cout << i18n(" # List the network devices present.\n") << endl;
404
cout << " solid-network listnetworks 'uni'" << endl;
405
cout << i18n(" # List the networks known to the device specified by 'uni'.\n") << endl;
407
cout << " solid-network query (status|wireless|wireless-hardware)|(interface 'uni')|(network 'device-uni' 'network-uni')" << endl;
408
cout << i18n(" # Query whether networking features are active or not.\n"
409
" # - If the 'status' option is given, return whether\n"
410
" # networking is enabled for the system\n"
411
" # - If the 'wireless' option is given, return whether\n"
412
" # wireless is enabled for the system\n"
413
" # - If the 'wireless-hardware' option is given,\n"
414
" # return whether the wireless hardware is enabled\n"
415
" # - If the 'interface' option is given, print the\n"
416
" # properties of the network interface that 'uni' refers to.\n"
417
" # - If the 'network' option is given, print the\n"
418
" # properties of the network on 'device-uni' that 'network-uni' refers to.\n") << endl;
420
cout << " solid-network set wireless (enabled|disabled)" << endl;
421
cout << i18n(" # Enable or disable networking on this system.\n") << endl;
423
cout << " solid-network set networking (enabled|disabled)" << endl;
424
cout << i18n(" # Enable or disable networking on this system.\n") << endl;
426
cout << " solid-network set network 'device-uni' 'network-uni' [authentication 'key']" << endl;
427
cout << i18n(" # Activate the network 'network-uni' on 'device-uni'.\n"
428
" # Optionally, use WEP128, open-system encryption with hex key 'key'. (Hardcoded)\n"
429
" # Where 'authentication' is one of:\n"
430
" # wep hex64|ascii64|hex128|ascii128|passphrase64|passphrase128 'key' [open|shared]\n"
431
" # wpapsk wpa|wpa2 tkip|ccmp-aes password\n"
432
" # wpaeap UNIMPLEMENTED IN SOLIDSHELL\n") << endl;
439
return SolidNetwork::doIt() ? 0 : 1;
442
bool SolidNetwork::doIt()
444
KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
445
checkArgumentCount(1, 0);
447
QString command(args->arg(0));
450
char **fake_argv = 0;
451
SolidNetwork shell(fake_argc, fake_argv);
453
if (command == "query")
455
checkArgumentCount(2, 4);
456
QString what(args->arg(1));
457
if (what == "status")
458
return shell.netmgrNetworkingEnabled();
459
else if (what == "wireless")
460
return shell.netmgrWirelessEnabled();
461
else if (what == "wireless-hardware")
462
return shell.netmgrWirelessHardwareEnabled();
463
else if (what == "interface")
465
checkArgumentCount(3, 3);
466
QString uni(args->arg(2));
467
return shell.netmgrQueryNetworkInterface(uni);
469
else if (what == "network")
471
checkArgumentCount(4, 4);
472
QString dev(args->arg(2));
473
QString uni(args->arg(3));
474
return shell.netmgrQueryNetwork(dev, uni);
477
cerr << i18n("Syntax Error: Unknown option '%1'", what) << endl;
479
else if (command == "set")
481
checkArgumentCount(3, 9);
482
QString what(args->arg(1));
483
QString how(args->arg(2));
484
if (what == "networking")
487
if (how == "enabled")
491
else if (how == "disabled")
497
cerr << i18n("Syntax Error: Unknown option '%1'", how) << endl;
500
shell.netmgrChangeNetworkingEnabled(enabled);
503
else if (what == "wireless")
506
if (how == "enabled")
510
else if (how == "disabled")
516
cerr << i18n("Syntax Error: Unknown option '%1'", how) << endl;
519
shell.netmgrChangeWirelessEnabled(enabled);
522
/*cout << " solid-network set network 'device-uni' 'network-uni' [authentication 'key']" << endl; */
523
/*wep hex64|ascii64|hex128|ascii128|passphrase 'key' [open|shared] */
524
/* wpaeap UNIMPLEMENTED */
525
else if (what == "network")
527
cerr << i18n("Not implemented");
528
#if 0 // probably won't be reimplemented since solidshell can't provide a persistent settings service...
529
checkArgumentCount(4, 9);
530
QString dev(args->arg(2));
531
QString uni(args->arg(3));
532
Solid::Control::Authentication * auth = 0;
533
QMap<QString,QString> secrets;
535
if (KCmdLineArgs::parsedArgs()->count() > 4)
537
QString hasAuth = args->arg(4);
538
if (hasAuth == "authentication")
541
QString authScheme = args->arg(5);
542
if (authScheme == "wep")
544
Solid::Control::AuthenticationWep *wepAuth = new Solid::Control::AuthenticationWep();
545
QString keyType = args->arg(6);
546
if (keyType == "hex64")
548
wepAuth->setType(Solid::Control::AuthenticationWep::WepHex);
549
wepAuth->setKeyLength(64);
551
else if (keyType == "ascii64")
553
wepAuth->setType(Solid::Control::AuthenticationWep::WepAscii);
554
wepAuth->setKeyLength(64);
556
else if (keyType == "hex128")
558
wepAuth->setType(Solid::Control::AuthenticationWep::WepHex);
559
wepAuth->setKeyLength(128);
561
else if (keyType == "ascii128")
563
wepAuth->setType(Solid::Control::AuthenticationWep::WepAscii);
564
wepAuth->setKeyLength(128);
566
else if (keyType == "passphrase64")
568
wepAuth->setType(Solid::Control::AuthenticationWep::WepPassphrase);
569
wepAuth->setKeyLength(64);
571
else if (keyType == "passphrase128")
573
wepAuth->setType(Solid::Control::AuthenticationWep::WepPassphrase);
574
wepAuth->setKeyLength(128);
578
cerr << i18n("Unrecognised WEP type '%1'", keyType) << endl;
583
QString key = args->arg(7);
584
secrets.insert("key", key);
585
wepAuth->setSecrets(secrets);
587
QString method = args->arg(8);
588
if (method == "open")
589
wepAuth->setMethod(Solid::Control::AuthenticationWep::WepOpenSystem);
590
else if (method == "shared")
591
wepAuth->setMethod(Solid::Control::AuthenticationWep::WepSharedKey);
594
cerr << i18n("Unrecognised WEP method '%1'", method) << endl;
600
else if (authScheme == "wpapsk")
602
/* wpapsk wpa|wpa2 tkip|ccmp-aes password */
603
Solid::Control::AuthenticationWpaPersonal *wpapAuth = new Solid::Control::AuthenticationWpaPersonal();
604
QString version = args->arg(6);
605
if (version == "wpa")
606
wpapAuth->setVersion(Solid::Control::AuthenticationWpaPersonal::Wpa1);
607
else if (version == "wpa2")
608
wpapAuth->setVersion(Solid::Control::AuthenticationWpaPersonal::Wpa1);
611
cerr << i18n("Unrecognised WPA version '%1'", version) << endl;
615
QString protocol = args->arg(7);
616
if (protocol == "tkip")
617
wpapAuth->setProtocol(Solid::Control::AuthenticationWpaPersonal::WpaTkip);
618
else if (protocol == "ccmp-aes")
619
wpapAuth->setProtocol(Solid::Control::AuthenticationWpaPersonal::WpaCcmpAes);
622
cerr << i18n("Unrecognised WPA encryption protocol '%1'", protocol) << endl;
626
QString key = args->arg(8);
627
secrets.insert("key", key);
628
wpapAuth->setSecrets(secrets);
633
cerr << i18n("Unimplemented auth scheme '%1'", args->arg(5)) << endl;
640
//unencrypted network
641
auth = new Solid::Control::AuthenticationNone;
644
return shell.netmgrActivateNetwork(dev, uni, auth);
650
cerr << i18n("Syntax Error: Unknown object '%1'", what) << endl;
654
else if (command == "listdevices")
656
return shell.netmgrList();
658
else if (command == "listnetworks")
660
checkArgumentCount(2, 2);
661
QString device(args->arg(1));
662
return shell.netmgrListNetworks(device);
666
cerr << i18n("Syntax Error: Unknown command '%1'" , command) << endl;
672
bool SolidNetwork::netmgrNetworkingEnabled()
674
if (Solid::Control::NetworkManager::isNetworkingEnabled())
675
cout << i18n("networking: is enabled")<< endl;
677
cout << i18n("networking: is not enabled")<< endl;
678
return Solid::Control::NetworkManager::isNetworkingEnabled();
681
bool SolidNetwork::netmgrWirelessEnabled()
683
if (Solid::Control::NetworkManager::isWirelessEnabled())
684
cout << i18n("wireless: is enabled")<< endl;
686
cout << i18n("wireless: is not enabled")<< endl;
687
return Solid::Control::NetworkManager::isWirelessEnabled();
690
bool SolidNetwork::netmgrWirelessHardwareEnabled()
692
if (Solid::Control::NetworkManager::isWirelessHardwareEnabled())
693
cout << i18n("wireless hardware: is enabled")<< endl;
695
cout << i18n("wireless hardware: is not enabled")<< endl;
696
return Solid::Control::NetworkManager::isWirelessHardwareEnabled();
699
bool SolidNetwork::netmgrChangeNetworkingEnabled(bool enabled)
701
Solid::Control::NetworkManager::setNetworkingEnabled(enabled);
705
bool SolidNetwork::netmgrChangeWirelessEnabled(bool enabled)
707
Solid::Control::NetworkManager::setWirelessEnabled(enabled);
711
bool SolidNetwork::netmgrList()
713
const Solid::Control::NetworkInterfaceList all = Solid::Control::NetworkManager::networkInterfaces();
715
cerr << "debug: network interface list contains: " << all.count() << " entries" << endl;
716
foreach (const Solid::Control::NetworkInterface *device, all)
718
cout << "UNI = '" << device->uni() << "'" << endl;
723
bool SolidNetwork::netmgrListNetworks(const QString & deviceUni)
725
Solid::Control::NetworkInterface * device = Solid::Control::NetworkManager::findNetworkInterface(deviceUni);
726
Solid::Control::WirelessNetworkInterface * wifiDev = qobject_cast<Solid::Control::WirelessNetworkInterface *>(device );
729
Solid::Control::AccessPointList aps = wifiDev->accessPoints();
730
foreach (const QString &apUni, aps)
732
cout << "NETWORK UNI = '" << apUni << "'" << endl;
740
bool SolidNetwork::netmgrQueryNetworkInterface(const QString & deviceUni)
742
cerr << "SolidNetwork::netmgrQueryNetworkInterface()" << endl;
743
Solid::Control::NetworkInterface * device = Solid::Control::NetworkManager::findNetworkInterface(deviceUni);
745
cerr << "No such interface: " << deviceUni << endl;
748
Solid::Control::WirelessNetworkInterface * wifiDev = qobject_cast<Solid::Control::WirelessNetworkInterface *>(device);
749
Solid::Control::WiredNetworkInterface * wiredDev = qobject_cast<Solid::Control::WiredNetworkInterface *>(device);
751
cout << *wifiDev << endl;
752
} else if (wiredDev) {
753
cout << *wiredDev << endl;
755
cout << *device << endl;
760
bool SolidNetwork::netmgrQueryNetwork(const QString & deviceUni, const QString & apUni)
762
cerr << "SolidNetwork::netmgrQueryNetwork()" << endl;
763
Solid::Control::NetworkInterface * device = Solid::Control::NetworkManager::findNetworkInterface(deviceUni);
764
Solid::Control::WirelessNetworkInterface * wifiDev = qobject_cast<Solid::Control::WirelessNetworkInterface *>(device );
766
Solid::Control::AccessPoint * ap = wifiDev->findAccessPoint( apUni );
776
bool SolidNetwork::netmgrActivateNetwork(const QString & deviceUni, const QString & networkUni, Solid::Control::Authentication * auth)
778
Solid::Control::NetworkInterface * device = Solid::Control::NetworkManager::findNetworkInterface(deviceUni);
779
Solid::Control::Network * network = device.findNetwork(networkUni);
780
Solid::Control::WirelessNetwork * wlan = 0;
781
if (( wlan = qobject_cast<Solid::Control::WirelessNetwork *>(network)))
783
wlan->setAuthentication(auth);
784
wlan->setActivated(true);
787
network->setActivated(true);
792
void SolidNetwork::connectJob(KJob *job)
794
connect(job, SIGNAL(result(KJob *)),
795
this, SLOT(slotResult(KJob *)));
796
connect(job, SIGNAL(percent(KJob *, unsigned long)),
797
this, SLOT(slotPercent(KJob *, unsigned long)));
798
connect(job, SIGNAL(infoMessage(KJob *, const QString &, const QString &)),
799
this, SLOT(slotInfoMessage(KJob *, const QString &)));
802
void SolidNetwork::slotPercent(KJob */*job */, unsigned long percent)
804
cout << i18n("Progress: %1%" , percent) << endl;
807
void SolidNetwork::slotInfoMessage(KJob */*job */, const QString &message)
809
cout << i18n("Info: %1" , message) << endl;
812
void SolidNetwork::slotResult(KJob *job)
818
m_error = job->error();
819
m_errorString = job->errorString();
825
void SolidNetwork::slotStorageResult(Solid::ErrorType error, const QVariant &errorData)
829
m_errorString = errorData.toString();
834
#include "solid-network.moc"