# HG changeset patch # User Jari Korhonen # Date 1274385404 -10800 # Node ID ee34bd26751e869627efe120f52d7790f4978a86 # Parent bb93f0593aeb6a3f0fa1d5f4defdf35256f99f3d Having some problems getting ip addr on win7. Debug output added. diff -r bb93f0593aeb -r ee34bd26751e mainwindow.cpp --- a/mainwindow.cpp Wed May 19 22:57:05 2010 +0300 +++ b/mainwindow.cpp Thu May 20 22:56:44 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 bb93f0593aeb -r ee34bd26751e mainwindow.h --- a/mainwindow.h Wed May 19 22:57:05 2010 +0300 +++ b/mainwindow.h Thu May 20 22:56:44 2010 +0300 @@ -153,6 +153,7 @@ bool isSelectedDeletable(QListWidget *workList); bool areAllSelectedCommitable(QListWidget *workList); QString findMyIp(); + void listAllUpAddresses(); //Actions enabled flags