connect(m_ui, SIGNAL(enableAutomaticLocationUpdate(bool, int)),
this, SLOT(enableAutomaticLocationUpdate(bool, int)));
+ connect(m_ui, SIGNAL(addTags(QStringList)),
+ m_situareService, SLOT(addTags(QStringList)));
+
+ connect(m_ui, SIGNAL(removeTags(QStringList)),
+ m_situareService, SLOT(removeTags(QStringList)));
+
// signals from user info tab
connect(m_ui, SIGNAL(refreshUserData()),
this, SLOT(refreshUserData()));
QStringList userIds;
QHashIterator<QString, QString> i(tags);
while (i.hasNext())
- userIds.append(i.key());
+ userIds.append(i.next().key());
QSqlQuery userQuery(QString("SELECT user.id, user.name, user.image_url FROM user WHERE "
"user.id IN (") + userIds.join(", ") + QString(") AND "
"user.latitude >= '%1' AND user.latitude < '%2' AND "
- "user.longitude >= '%3' AND user.longitude < '%4")
+ "user.longitude >= '%3' AND user.longitude < '%4'")
.arg(southWestCoordinates.latitude()).arg(northEastCoordinates.latitude())
.arg(southWestCoordinates.longitude()).arg(northEastCoordinates.longitude()));
-
+ qWarning() << userQuery.lastQuery();
QString result;
result.append("{\"people\": [");
return result.toUtf8();
}
-QStringList Database::getTags(qulonglong userId)
+QHash<QString, QString> Database::getTags(qulonglong userId)
{
qDebug() << __PRETTY_FUNCTION__;
- QStringList tags;
+ QHash<QString, QString> tags;
- QSqlQuery query(QString("SELECT tag.name FROM usertag, tag WHERE usertag.userid = '%1' "
+ QSqlQuery query(QString("SELECT tag.id, tag.name FROM usertag, tag WHERE usertag.userid = '%1' "
"AND usertag.tagid = tag.id").arg(userId));
while (query.next())
- tags.append(query.value(0).toString());
+ tags.insert(query.value(0).toString(), query.value(1).toString());
return tags;
}
return m_database.open();
}
+bool Database::removeTags(qulonglong userId, const QStringList &tags)
+{
+ qDebug() << __PRETTY_FUNCTION__;
+
+ QSqlQuery removeTagsQuery;
+
+ bool val = removeTagsQuery.exec(QString("DELETE FROM usertag WHERE usertag.userid = "
+ "'%1' AND usertag.tagid IN (").arg(userId) +
+ tags.join(", ") + ")");
+
+ qWarning() << __PRETTY_FUNCTION__ << val;
+ qWarning() << removeTagsQuery.lastQuery();
+
+ return true;
+}
+
bool Database::sendMessage(qulonglong senderId, qulonglong receiverId, const QString &message)
{
qDebug() << __PRETTY_FUNCTION__;
bool addTag(qulonglong userId, const QString &tag);
QByteArray getNotifications(qulonglong userId);
- QStringList getTags(qulonglong userId);
+ QHash<QString, QString> getTags(qulonglong userId);
QByteArray getInterestingPeople(qulonglong userId,
const GeoCoordinate &southWestCoordinates,
const GeoCoordinate &northEastCoordinates);
bool createUserTagTable();
bool createUserTable();
bool openDatabase();
+ bool removeTags(qulonglong userId, const QStringList &tags);
bool sendMessage(qulonglong senderId, qulonglong receiverId, const QString &message);
private:
qDebug() << __PRETTY_FUNCTION__;
//Request sent to server does not need the UID
- QByteArray arr = m_database->getNotifications(m_user->userId().toULongLong());
+ QByteArray arr = m_database->getNotifications(613374451);
parseMessagesData(arr);
}
qDebug() << __PRETTY_FUNCTION__;
//Request sent to server does not need the UID
- QByteArray arr = m_database->getInterestingPeople(m_user->userId().toULongLong(),
+ QByteArray arr = m_database->getInterestingPeople(613374451,
southWestCoordinates,
northEastCoordinates);
{
qDebug() << __PRETTY_FUNCTION__;
- qWarning() << __PRETTY_FUNCTION__ << m_database->sendMessage(m_user->userId().toULongLong(), receiverId.toULongLong(), message);
+ qWarning() << __PRETTY_FUNCTION__ << m_database->sendMessage(613374451, receiverId.toULongLong(), message);
}
void SituareService::sendRequest(const QUrl &url, const QString &cookieType, const QString &cookie)
emit userDataChanged(m_user, m_friendsList);
}
-QStringList SituareService::getTags(const QString &userId)
+QHash<QString, QString> SituareService::getTags(const QString &userId)
{
qDebug() << __PRETTY_FUNCTION__;
return m_database->getTags(userId.toInt());
}
-void SituareService::updateTags(const QString &userId, const QStringList &tags)
+void SituareService::removeTags(const QStringList &tags)
+{
+ qDebug() << __PRETTY_FUNCTION__;
+
+ m_database->removeTags(613374451, tags);
+}
+
+void SituareService::addTags(const QStringList &tags)
{
qDebug() << __PRETTY_FUNCTION__;
foreach (QString tag, tags)
- m_database->addTag(userId.toInt(), tag);
+ m_database->addTag(613374451, tag);
}
*/
void updateLocation(const GeoCoordinate &coordinates, const QString &status, const bool &publish);
+public slots:
/**
- * @brief Updates tags to the Situare server
+ * @brief Adds tags to the Situare server
*
* CURRENTLY TAGS ARE UPDATED TO THE LOCAL DATABASE, NOT SITUARE SERVER
- * @param userId user ID
* @param tags list of user's tags
*/
- void updateTags(const QString &userId, const QStringList &tags);
+ void addTags(const QStringList &tags);
-public slots:
/**
* @brief Retrieves messages sent to user.
*/
void credentialsReady(const FacebookCredentials &credentials);
/**
+ * @brief Removes tags.
+ *
+ * @param tags list of tags to remove
+ */
+ void removeTags(const QStringList &tags);
+
+ /**
* @brief Public slot, which indicates when http request has been completed
*
* @param reply storage for http reply
* @param userId
* @return QStringList list of tags
*/
- QStringList getTags(const QString &userId);
+ QHash<QString, QString> getTags(const QString &userId);
/**
* @brief Parses interesting people data from JSON string
#include "extendedlistitem.h"
-ExtendedListItem::ExtendedListItem()
- : m_selected(false),
+ExtendedListItem::ExtendedListItem(QListWidget *parent, int type)
+ : ListItem(parent, type),
+ m_selected(false),
m_expandedHeight(ITEM_MIN_HEIGHT),
m_normalHeight(ITEM_MIN_HEIGHT),
m_subItemTextWidth(SUBITEM_TEXT_MAX_WIDTH)
*
* Sets item size and creates sub item store list.
*/
- ExtendedListItem();
+ ExtendedListItem(QListWidget *parent = 0, int type = Type);
/**
* @brief Destructor.
#include "listitem.h"
-ListItem::ListItem()
+ListItem::ListItem(QListWidget *parent, int type)
+ : QListWidgetItem(parent, type)
{
qDebug() << __PRETTY_FUNCTION__;
/**
* @brief Constructor.
*/
- ListItem();
+ ListItem(QListWidget *parent = 0, int type = Type);
/**
* @brief Defines text size.
ListItem *currentItem = dynamic_cast<ListItem*>(item);
- if (currentItem)
+ if (currentItem && (currentItem->type() != QListWidgetItem::UserType))
listItemClicked(currentItem);
}
connect(this, SIGNAL(userImageReady(QString,QPixmap)),
m_userInfoPanel, SLOT(setImage(QString,QPixmap)));
+
+ connect(m_userInfoPanel, SIGNAL(addTags(QStringList)),
+ this, SIGNAL(addTags(QStringList)));
+
+ connect(m_userInfoPanel, SIGNAL(removeTags(QStringList)),
+ this, SIGNAL(removeTags(QStringList)));
}
void MainWindow::buildWebView()
******************************************************************************/
signals:
/**
+ * @brief Signal for adding tags.
+ *
+ * @param tags tags to add
+ */
+ void addTags(const QStringList &tags);
+
+ /**
* @brief Automatic centering setting changed by user
*
* @param enabled True if automatic centering is enabled, otherwise false
void refreshUserData();
/**
+ * @brief Signal for removing tags.
+ *
+ * @param tags tags to add
+ */
+ void removeTags(const QStringList &tags);
+
+ /**
* @brief Requests contact dialog.
*
* @param facebookId contact's facebookId
for (int i = 0; i < interestingPeople.count(); ++i) {
if (i == 0) {
m_personListView->setItemDelegateForRow(i, new HeaderListItemDelegate(this));
- ExtendedListItem *item = new ExtendedListItem();
+ ExtendedListItem *item = new ExtendedListItem(0, QListWidgetItem::UserType);
item->setTitle(tr("Friends:"));
m_personListView->addListItem(QString("header") + QString::number(i), item);
}
else if (i == 2) {
m_personListView->setItemDelegateForRow(i+1, new HeaderListItemDelegate(this));
- ExtendedListItem *item = new ExtendedListItem();
+ ExtendedListItem *item = new ExtendedListItem(0, QListWidgetItem::UserType);
item->setTitle(tr("Others:"));
m_personListView->addListItem(QString("header") + QString::number(i), item);
}
#include "tagsdialog.h"
-TagsDialog::TagsDialog(const QStringList &tags)
+TagsDialog::TagsDialog(const QHash<QString, QString> &tags)
{
qDebug() << __PRETTY_FUNCTION__;
setWindowTitle(tr("Edit tags"));
QGridLayout *gridLayout = new QGridLayout;
- m_addTagEdit = new QLineEdit("sdsds");
+ m_addTagEdit = new QLineEdit("");
QDialogButtonBox *buttonBox = new QDialogButtonBox(Qt::Vertical);
QPushButton *addButton = buttonBox->addButton(tr("Add"), QDialogButtonBox::ActionRole);
connect(cancelButton, SIGNAL(clicked()),
this, SLOT(reject()));
+
+ connect(addButton, SIGNAL(clicked()),
+ this, SLOT(addTagToList()));
+
+ connect(deleteButton, SIGNAL(clicked()),
+ this, SLOT(deleteTagFromList()));
}
-QStringList TagsDialog::userTags()
+void TagsDialog::addTagToList()
{
qDebug() << __PRETTY_FUNCTION__;
- QStringList tags;
- for (int i = 0; i < m_tagsView->count(); ++i) {
- QListWidgetItem *tagItem = m_tagsView->item(i);
- if (tagItem)
- tags.append(tagItem->text());
+ QList<QListWidgetItem *> findItems = m_tagsView->findItems(m_addTagEdit->text(),
+ Qt::MatchExactly);
+
+ if (findItems.isEmpty()) {
+ m_tagsView->insertItem(0, m_addTagEdit->text());
+ m_newTags.append(m_addTagEdit->text());
}
- return tags;
+ m_addTagEdit->setText("");
+}
+
+void TagsDialog::deleteTagFromList()
+{
+ qDebug() << __PRETTY_FUNCTION__;
+
+ QList<QListWidgetItem *> selectedItems = m_tagsView->selectedItems();
+
+ if (!selectedItems.isEmpty()) {
+ QListWidgetItem *selectedItem = selectedItems.at(0);
+ m_tagsView->takeItem(m_tagsView->row(selectedItem));
+
+ if (m_newTags.contains(selectedItem->text()))
+ m_newTags.removeOne(selectedItem->text());
+ else
+ m_removedTags.append(selectedItem->text());
+ }
+}
+
+QStringList TagsDialog::newTags()
+{
+ qDebug() << __PRETTY_FUNCTION__;
+
+ return m_newTags;
+}
+
+QStringList TagsDialog::removedTags()
+{
+ qDebug() << __PRETTY_FUNCTION__;
+
+ return m_removedTags;
}
#define TAGSDIALOG_H
#include <QDialog>
+#include <QHash>
class QDialogButtonBox;
class QLabel;
public:
/**
+ * @brief Unit test class.
+ */
+ friend class TestTagsDialog;
+
+ /**
* @brief Default constructor
*
* @param parent Instance of parent widget
*/
- TagsDialog(const QStringList &tags);
+ TagsDialog(const QHash<QString, QString> &tags);
/*******************************************************************************
* MEMBER FUNCTIONS AND SLOTS
public:
/**
- * @brief Gets user tags.
+ * @brief Gets new tags.
+ *
+ * @return list of new tags
+ */
+ QStringList newTags();
+
+ /**
+ * @brief Gets removed tags.
*
- * @param email Email address
- * @param password Password
+ * @return list of removed tags
*/
- QStringList userTags();
+ QStringList removedTags();
+
+private slots:
+ /**
+ * @brief Adds tag to the list.
+ */
+ void addTagToList();
+
+ /**
+ * @brief Deletes tag from the list.
+ */
+ void deleteTagFromList();
/*******************************************************************************
* DATA MEMBERS
******************************************************************************/
private:
- QLineEdit *m_addTagEdit;
+ QLineEdit *m_addTagEdit; ///< Add tag line edit
+
+ QListWidget *m_tagsView; ///< Tag list view
- QListWidget *m_tagsView;
+ QStringList m_newTags; ///< List of new tags
+ QStringList m_removedTags; ///< Removed tags
};
#endif // LOGINDIALOG_H
m_backgroundTopImage.load(":/res/images/list_item_top.png");
m_backgroundMiddleImage.load(":/res/images/list_item_middle.png");
m_backgroundBottomImage.load(":/res/images/list_item_bottom.png");
+ m_backgroundTopSelectedImage.load(":/res/images/list_item_top_selected.png");
+ m_backgroundMiddleSelectedImage.load(":/res/images/list_item_middle_selected.png");
+ m_backgroundBottomSelectedImage.load(":/res/images/list_item_bottom_selected.png");
restoreUnsendMessage();
}
setExpanded(true);
m_expanded = true;
}
+ update();
}
}
QRect topRect = QRect(0, MARGIN, BACKGROUND_WIDTH, BACKGROUND_TOP_HEIGHT);
- QRect middleRect = QRect(topRect.left(), topRect.bottom() + 1, BACKGROUND_WIDTH,
- this->height() - BACKGROUND_TOP_HEIGHT - BACKGROUND_BOTTOM_HEIGHT);
+ QRect middleRect = QRect(topRect.left(), topRect.bottom(), BACKGROUND_WIDTH,
+ height() - BACKGROUND_TOP_HEIGHT - BACKGROUND_BOTTOM_HEIGHT);
- QRect bottomRect = QRect(topRect.left(), middleRect.bottom() + 1, BACKGROUND_WIDTH,
+ QRect bottomRect = QRect(topRect.left(), middleRect.bottom(), BACKGROUND_WIDTH,
BACKGROUND_BOTTOM_HEIGHT);
- painter.drawPixmap(topRect, m_backgroundTopImage);
- painter.drawPixmap(middleRect, m_backgroundMiddleImage);
- painter.drawPixmap(bottomRect, m_backgroundBottomImage);
+ if (m_expanded) {
+ painter.drawPixmap(topRect, m_backgroundTopSelectedImage);
+ painter.drawPixmap(middleRect, m_backgroundMiddleSelectedImage);
+ painter.drawPixmap(bottomRect, m_backgroundBottomSelectedImage);
+ } else {
+ painter.drawPixmap(topRect, m_backgroundTopImage);
+ painter.drawPixmap(middleRect, m_backgroundMiddleImage);
+ painter.drawPixmap(bottomRect, m_backgroundBottomImage);
+ }
}
void UserInfo::restoreUnsendMessage()
emit itemSelectionChanged(expanded);
}
-void UserInfo::setTags(const QStringList &tags)
+void UserInfo::setTags(const QHash<QString, QString> &tags)
{
qDebug() << __PRETTY_FUNCTION__;
QString tagsText;
- foreach (QString tag, tags)
- tagsText.append("[" + tag + "] ");
+ QHashIterator<QString, QString> tagsIterator(tags);
+ while (tagsIterator.hasNext()) {
+ tagsIterator.next();
+ tagsText.append("[" + tagsIterator.value() + "] ");
+ }
m_tagsTextLabel->setText(tagsText);
}
void UserInfo::tagsDialogFinished(int reason)
{
-qDebug() << __PRETTY_FUNCTION__;
+ qDebug() << __PRETTY_FUNCTION__;
- if (reason == QDialog::Accepted) {
- QStringList userTags = m_tagsDialog->userTags();
- }
+ if (m_tagsDialog) {
+ if (reason == QDialog::Accepted) {
+ QStringList removedTagsIds;
+
+ foreach (QString removedTag, m_tagsDialog->removedTags())
+ removedTagsIds.append(m_userTags.key(removedTag));
- m_tagsDialog->deleteLater();
+ emit removeTags(removedTagsIds);
+ emit addTags(m_tagsDialog->newTags());
+ }
+
+ m_tagsDialog->deleteLater();
+ m_tagsDialog = 0;
+ }
}
void UserInfo::updateLocationDialogFinished(int reason)
*
* @param tags list of tags
*/
- void setTags(const QStringList &tags);
+ void setTags(const QHash<QString, QString> &tags);
/**
* @brief Sets the time of updated message
******************************************************************************/
signals:
/**
+ * @brief Signal for adding tags.
+ *
+ * @param tags tags to add
+ */
+ void addTags(const QStringList &tags);
+
+ /**
* @brief Signal for finding user.
*
* @param coordinates user geo coordinates
void requestReverseGeo();
/**
+ * @brief Signal for removing tags.
+ *
+ * @param tags tags to add
+ */
+ void removeTags(const QStringList &tags);
+
+ /**
* @brief Signals, when address data is ready
*
* @param address Street address
QPixmap m_backgroundBottomImage; ///< Bottom background image
QPixmap m_backgroundMiddleImage; ///< Middle background image
QPixmap m_backgroundTopImage; ///< Top background image
+ QPixmap m_backgroundBottomSelectedImage; ///< Selected bottom background image
+ QPixmap m_backgroundMiddleSelectedImage; ///< Selected middle background image
+ QPixmap m_backgroundTopSelectedImage; ///< Selected top background image
QPoint m_mousePosition; ///< Current mouse press position
QString m_messageText; ///< User's message
QString m_userName; ///< User's name
- QStringList m_userTags; ///< User's tags
+ QHash<QString, QString> m_userTags; ///< User's tags
GeoCoordinate m_coordinates; ///< User current coordinates
ImageButton *m_avatar; ///< User find button
connect(m_userInfo, SIGNAL(itemSelectionChanged(bool)),
this, SLOT(onUserInfoItemSelected(bool)));
+ connect(m_userInfo, SIGNAL(addTags(QStringList)),
+ this, SIGNAL(addTags(QStringList)));
+
+ connect(m_userInfo, SIGNAL(removeTags(QStringList)),
+ this, SIGNAL(removeTags(QStringList)));
+
ImageButton *updateFriendsButton = new ImageButton(":/res/images/refresh.png",
":/res/images/refresh_s.png",
"", this);
******************************************************************************/
signals:
/**
+ * @brief Signal for adding tags.
+ *
+ * @param tags tags to add
+ */
+ void addTags(const QStringList &tags);
+
+ /**
* @brief Signal for collapse user info
*/
void collapse();
void refreshUserData();
/**
+ * @brief Signal for removing tags.
+ *
+ * @param tags tags to add
+ */
+ void removeTags(const QStringList &tags);
+
+ /**
* @brief Signal for requesting reverseGeo from SituareEngine
*/
void requestReverseGeo();
User::User(const QString &address, const GeoCoordinate &coordinates, const QString &name,
const QString ¬e, const QUrl &imageUrl, const QString ×tamp, const bool &type,
- const QString &userId, const QString &units, const double &value,
- const QStringList &tags)
+ const QString &userId, const QString &units, const double &value)
: m_address(address)
, m_coordinates(coordinates)
, m_name(name)
, m_note(note)
, m_profileImageUrl(imageUrl)
- , m_tags(tags)
, m_timestamp(timestamp)
, m_type(type)
, m_units(units)
m_profileImageUrl = imageUrl;
}
-void User::setTags(const QStringList &tags)
+void User::setTags(const QHash<QString, QString> &tags)
{
m_tags = tags;
}
void User::setTags(const QList<QVariant> &tags)
{
- QStringList tagsStrings;
+ QHash<QString, QString> tagsStrings;
- foreach (QVariant tag, tags)
- tagsStrings.append(tag.toString());
+ for (int i = 0; i < tags.count(); ++i)
+ tagsStrings.insert(QString::number(i), tags.at(i).toString());
m_tags = tagsStrings;
}
return m_profileImageUrl;
}
-const QStringList& User::tags() const
+const QHash<QString, QString>& User::tags() const
{
return m_tags;
}
User(const QString &address, const GeoCoordinate &coordinates, const QString &name,
const QString ¬e, const QUrl &imageUrl, const QString ×tamp,
const bool &type, const QString &userId, const QString &units = 0,
- const double &value = 0, const QStringList &tags = QStringList());
+ const double &value = 0);
/**
* @brief Default constructor, initializes member data as NULL/0
*
* @param tags user's tags
*/
- void setTags(const QStringList &tags);
+ void setTags(const QHash<QString, QString> &tags);
/**
* @brief Sets user's tags.
*
* @return QStringList list of tags
*/
- const QStringList &tags() const;
+ const QHash<QString, QString> &tags() const;
/**
* @brief Get timestamp of last status update
QString m_name; ///< placeholder for name
QString m_note; ///< placeholder for note
QUrl m_profileImageUrl; ///< placeholder for image url
- QStringList m_tags; ///< placeholder for tags
+ QHash<QString, QString> m_tags; ///< placeholder for tags
QString m_timestamp; ///< placeholer for timestamp
bool m_type; ///< placeholder for user type
QString m_units; ///< placeholder for distance unit type
--- /dev/null
+CONFIG += qtestlib
+DEFINES += QT_NO_DEBUG_OUTPUT
+INCLUDEPATH += . \
+ ../../../src/
+
+HEADERS += \
+ ../../../src/ui/tagsdialog.h
+
+SOURCES += \
+ ../../../src/ui/tagsdialog.cpp \
+ testtagsdialog.cpp
--- /dev/null
+/*
+ Situare - A location system for Facebook
+ Copyright (C) 2010 Ixonos Plc. Authors:
+
+ Jussi Laitinen - jussi.laitinen@ixonos.com
+
+ Situare is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ version 2 as published by the Free Software Foundation.
+
+ Situare is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Situare; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+ USA.
+*/
+
+#include <QtTest>
+#include <QtGui>
+
+#include "../../../src/ui/tagsdialog.h"
+
+class TestTagsDialog: public QObject
+{
+ Q_OBJECT
+
+private slots:
+ void initTestCase();
+ void cleanup();
+ void init();
+ void addTagToList();
+ void addAndDeleteTag();
+
+private:
+ QHash<QString, QString> m_tags;
+ TagsDialog *m_tagsDialog;
+};
+
+void TestTagsDialog::cleanup()
+{
+ delete m_tagsDialog;
+}
+
+void TestTagsDialog::init()
+{
+ m_tagsDialog = new TagsDialog(m_tags);
+ QVERIFY(m_tagsDialog);
+ QCOMPARE(m_tagsDialog->m_tagsView->count(), 3);
+}
+
+void TestTagsDialog::initTestCase()
+{
+ m_tags.insert("1", "pop");
+ m_tags.insert("2", "rock");
+ m_tags.insert("3", "britney spears");
+}
+
+void TestTagsDialog::addTagToList()
+{
+ m_tagsDialog->m_addTagEdit->setText("new age");
+ m_tagsDialog->addTagToList();
+ QCOMPARE(m_tagsDialog->m_tagsView->count(), 4);
+ QCOMPARE(m_tagsDialog->m_tagsView->item(0)->text(), QString("new age"));
+ QVERIFY(m_tagsDialog->newTags().contains("new age"));
+}
+
+void TestTagsDialog::addAndDeleteTag()
+{
+ addTagToList();
+
+ m_tagsDialog->m_tagsView->setItemSelected(m_tagsDialog->m_tagsView->item(0), true);
+ m_tagsDialog->deleteTagFromList();
+ QCOMPARE(m_tagsDialog->m_tagsView->count(), 3);
+ QVERIFY(m_tags.contains("1"));
+ QVERIFY(m_tags.contains("2"));
+ QVERIFY(m_tags.contains("3"));
+
+ QListWidgetItem *item = m_tagsDialog->m_tagsView->item(0);
+ m_tagsDialog->m_tagsView->setItemSelected(item, true);
+ m_tagsDialog->deleteTagFromList();
+ QCOMPARE(m_tagsDialog->m_tagsView->count(), 2);
+ QVERIFY(m_tagsDialog->removedTags().contains(item->text()));
+}
+
+QTEST_MAIN(TestTagsDialog)
+#include "testtagsdialog.moc"