X-Git-Url: http://vcs.maemo.org/git/?a=blobdiff_plain;f=accountdialog.cpp;h=39024b7e709bc0b17c45127f7caddd80bf89aa64;hb=b93d2c4b62822a332aa42e1b4c93506ba0998341;hp=c87215a3aa0da78ba1125860b7cc5d1705cf223c;hpb=548d8d72deaba76b2d2fc21210cf3e7870eb4cf8;p=vlc-remote diff --git a/accountdialog.cpp b/accountdialog.cpp index c87215a..39024b7 100644 --- a/accountdialog.cpp +++ b/accountdialog.cpp @@ -109,6 +109,7 @@ void AccountDialog::load() QListWidgetItem AccountDialog::asyncTestItem(const QListWidgetItem& item) { + //==========> NEED TO USE POINTER TO AVOID setAsyncItem! But I don't know how;.. QListWidgetItem newItem = item; QTcpSocket * socket = new QTcpSocket; @@ -122,9 +123,9 @@ QListWidgetItem AccountDialog::asyncTestItem(const QListWidgetItem& item) socket->connectToHost(ip,port.toInt()); if (socket->waitForConnected(1000)) - newItem.setBackgroundColor(Qt::green); + newItem.setIcon(QIcon::fromTheme("widgets_tickmark_list")); else - newItem.setBackgroundColor(Qt::red); + newItem.setIcon(QIcon::fromTheme("statusarea_presence_busy_error")); return newItem; @@ -138,7 +139,7 @@ void AccountDialog::setAsyncItem(int row) // EDIT THE ROW AFTER ASYNC FUNCTION QListWidgetItem newItem = mFuturWatcher->resultAt(row); QListWidgetItem * item = ui->listWidget->item(row); - item->setBackgroundColor(newItem.backgroundColor()); + item->setIcon(newItem.icon());