From: lepelley Date: Tue, 17 Aug 2010 02:18:41 +0000 (+0200) Subject: add icons for avaible IP account X-Git-Tag: v0.5~44 X-Git-Url: https://vcs.maemo.org/git/?p=vlc-remote;a=commitdiff_plain;h=b93d2c4b62822a332aa42e1b4c93506ba0998341 add icons for avaible IP account --- 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());