summaryrefslogtreecommitdiffstats
path: root/tdeui/tests/kxmlguitest.cpp
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-11-06 15:56:40 -0600
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-11-06 15:56:40 -0600
commite16866e072f94410321d70daedbcb855ea878cac (patch)
treeee3f52eabde7da1a0e6ca845fb9c2813cf1558cf /tdeui/tests/kxmlguitest.cpp
parenta58c20c1a7593631a1b50213c805507ebc16adaf (diff)
downloadtdelibs-e16866e072f94410321d70daedbcb855ea878cac.tar.gz
tdelibs-e16866e072f94410321d70daedbcb855ea878cac.zip
Actually move the kde files that were renamed in the last commit
Diffstat (limited to 'tdeui/tests/kxmlguitest.cpp')
-rw-r--r--tdeui/tests/kxmlguitest.cpp64
1 files changed, 64 insertions, 0 deletions
diff --git a/tdeui/tests/kxmlguitest.cpp b/tdeui/tests/kxmlguitest.cpp
new file mode 100644
index 000000000..a903aeb3f
--- /dev/null
+++ b/tdeui/tests/kxmlguitest.cpp
@@ -0,0 +1,64 @@
+#include "kxmlguitest.h"
+#include <kapplication.h>
+#include <kmainwindow.h>
+#include <kxmlguifactory.h>
+#include <kxmlguiclient.h>
+#include <kxmlguibuilder.h>
+#include <kaction.h>
+#include <kdebug.h>
+#include <kstdaction.h>
+#include <kstandarddirs.h>
+#include <tqlineedit.h>
+#include <tqdir.h>
+
+void Client::slotSec()
+{
+ kdDebug() << "Client::slotSec()" << endl;
+}
+
+int main( int argc, char **argv )
+{
+ KApplication app( argc, argv, "kxmlguitest" );
+
+ // KXMLGUIClient looks in the "data" resource for the .rc files
+ // Let's add $PWD (ideally $srcdir instead...) to it
+ KGlobal::dirs()->addResourceDir( "data", TQDir::currentDirPath() );
+
+ KMainWindow *mainwindow = new KMainWindow;
+
+ TQLineEdit* line = new TQLineEdit( mainwindow );
+ mainwindow->setCentralWidget( line );
+
+ mainwindow->show();
+
+ KXMLGUIBuilder *builder = new KXMLGUIBuilder( mainwindow );
+
+ KXMLGUIFactory *factory = new KXMLGUIFactory( builder );
+
+ Client *shell = new Client;
+ shell->setInstance( new KInstance( "konqueror" ) );
+ shell->instance()->dirs()->addResourceDir( "data", TQDir::currentDirPath() );
+
+ (void)new KAction( "Split", "view_left_right", 0, 0, 0, shell->actionCollection(), "splitviewh" );
+
+ shell->setXMLFile( "./kxmlguitest_shell.rc" );
+
+ factory->addClient( shell );
+
+ Client *part = new Client;
+
+ (void)new KAction( "decfont", "viewmag-", 0, 0, 0, part->actionCollection(), "decFontSizes" );
+ (void)new KAction( "sec", "unlock", Qt::ALT + Qt::Key_1, part, TQT_SLOT( slotSec() ), part->actionCollection(), "security" );
+
+ part->setXMLFile( "./kxmlguitest_part.rc" );
+
+ factory->addClient( part );
+ for ( int i = 0; i < 10; ++i )
+ {
+ factory->removeClient( part );
+ factory->addClient( part );
+ }
+
+ return app.exec();
+}
+#include "kxmlguitest.moc"