aboutsummaryrefslogtreecommitdiff
path: root/tests/client/treeviewtest.cpp
diff options
context:
space:
mode:
authorRenato Araujo Oliveira Filho <renato.filho@canonical.com>2013-01-10 15:54:35 -0300
committerRenato Araujo Oliveira Filho <renato.filho@canonical.com>2013-01-10 15:54:35 -0300
commit33147e96ae17a01a3f025a5b7b78bff7943b4851 (patch)
tree5b9f5421585d19516f0b8f964eb878e0695f5d43 /tests/client/treeviewtest.cpp
parent2d050cddb8a4aa3ada8f956e071efed9d53898fd (diff)
downloadqmenumodel-33147e96ae17a01a3f025a5b7b78bff7943b4851.tar.gz
qmenumodel-33147e96ae17a01a3f025a5b7b78bff7943b4851.tar.bz2
qmenumodel-33147e96ae17a01a3f025a5b7b78bff7943b4851.zip
Fixed item removal and insertion.
Removed debug messages. Fixed tests to work with new tree model structure.
Diffstat (limited to 'tests/client/treeviewtest.cpp')
-rw-r--r--tests/client/treeviewtest.cpp88
1 files changed, 0 insertions, 88 deletions
diff --git a/tests/client/treeviewtest.cpp b/tests/client/treeviewtest.cpp
deleted file mode 100644
index 527ebd3..0000000
--- a/tests/client/treeviewtest.cpp
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Copyright 2012 Canonical Ltd.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; version 3.
- *
- * This program 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 Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- * Authors:
- * Renato Araujo Oliveira Filho <renato@canonical.com>
- * Olivier Tilloy <olivier.tilloy@canonical.com>
- */
-
-#include "qmenumodel.h"
-
-extern "C" {
-#include <gio/gio.h>
-}
-
-#include <QtTest>
-#include <QTreeView>
-#include <QFileSystemModel>
-
-
-class TestModel : public QMenuModel
-{
- Q_OBJECT
-public:
- TestModel() : QMenuModel(0)
- {
- GMenu *menu5 = g_menu_new();
- g_menu_append(menu5, "menu6", NULL);
- g_menu_append(menu5, "menu7", NULL);
-
- GMenu *menu3 = g_menu_new();
- g_menu_append(menu3, "menu4", NULL);
- g_menu_append_section(menu3, "menu5", G_MENU_MODEL(menu5));
- g_menu_append(menu3, "menu8", NULL);
-
- GMenu *menu = g_menu_new();
- g_menu_append(menu, "menu0", NULL);
- g_menu_append(menu, "menu1", NULL);
- g_menu_append(menu, "menu2", NULL);
- g_menu_append_section(menu, "menu3", G_MENU_MODEL(menu3));
-
- setMenuModel(G_MENU_MODEL(menu));
-
- m_menus << menu << menu3 << menu5;
- }
-
-private:
- QList<GMenu*> m_menus;
-};
-
-class TreeViewTest : public QObject
-{
- Q_OBJECT
-
-private Q_SLOTS:
- void initTestCase()
- {
- g_type_init();
- }
-
- void testView()
- {
- TestModel menu;
- //QFileSystemModel menu; // = new QFileSystemModel;
- //menu.setRootPath(QDir::currentPath());
- QTreeView *tree = new QTreeView;
- tree->setModel(&menu);
- tree->show();
- QApplication::exec();
- }
-
-};
-
-QTEST_MAIN(TreeViewTest)
-
-#include "treeviewtest.moc"
-