# HG changeset patch # User Jari Korhonen # Date 1274385829 -10800 # Node ID 6e8cd5ffa4dff91ce082ad5e96383201dfa28ee0 # Parent eba979148fb34393a9903a4f195be0dc56e17842# Parent ee34bd26751e869627efe120f52d7790f4978a86 merge. diff -r eba979148fb3 -r 6e8cd5ffa4df mainwindow.cpp --- a/mainwindow.cpp Wed May 19 23:08:42 2010 +0300 +++ b/mainwindow.cpp Thu May 20 23:03:49 2010 +0300 @@ -547,9 +547,35 @@ } + +void MainWindow::listAllUpAddresses() +{ + QList ifaces = QNetworkInterface::allInterfaces(); + + for (int i = 0; i < ifaces.count(); i++) + { + QNetworkInterface iface = ifaces.at(i); + + QString msg; + + QTextStream(&msg) << "name: " << iface.name() << endl << "mac: " << iface.hardwareAddress() << endl; + QMessageBox::information(this, "interface", msg); + + if (iface.flags().testFlag(QNetworkInterface::IsUp) && !iface.flags().testFlag(QNetworkInterface::IsLoopBack)) + { + // this loop is important + for (int j=0; j ipList = QNetworkInterface::allAddresses(); diff -r eba979148fb3 -r 6e8cd5ffa4df mainwindow.h --- a/mainwindow.h Wed May 19 23:08:42 2010 +0300 +++ b/mainwindow.h Thu May 20 23:03:49 2010 +0300 @@ -153,6 +153,7 @@ bool isSelectedDeletable(QListWidget *workList); bool areAllSelectedCommitable(QListWidget *workList); QString findMyIp(); + void listAllUpAddresses(); //Actions enabled flags