summaryrefslogtreecommitdiffstats
path: root/konq-plugins/fsview/main.cpp
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commit84da08d7b7fcda12c85caeb5a10b4903770a6f69 (patch)
tree2a6aea76f2dfffb4cc04bb907c4725af94f70e72 /konq-plugins/fsview/main.cpp
downloadtdeaddons-84da08d7b7fcda12c85caeb5a10b4903770a6f69.tar.gz
tdeaddons-84da08d7b7fcda12c85caeb5a10b4903770a6f69.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeaddons@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'konq-plugins/fsview/main.cpp')
-rw-r--r--konq-plugins/fsview/main.cpp56
1 files changed, 56 insertions, 0 deletions
diff --git a/konq-plugins/fsview/main.cpp b/konq-plugins/fsview/main.cpp
new file mode 100644
index 0000000..da18dcf
--- /dev/null
+++ b/konq-plugins/fsview/main.cpp
@@ -0,0 +1,56 @@
+/*****************************************************
+ * FSView, a simple TreeMap application
+ *
+ * (C) 2002, Josef Weidendorfer
+ */
+
+#include <kapplication.h>
+#include <kcmdlineargs.h>
+#include <kaboutdata.h>
+#include <klocale.h>
+#include <kglobal.h>
+#include <kconfig.h>
+
+#include "fsview.h"
+
+
+static KCmdLineOptions options[] =
+{
+ { "+[folder]", I18N_NOOP("View filesystem starting from this folder"), 0 },
+ KCmdLineLastOption // End of options.
+};
+
+int main(int argc, char* argv[])
+{
+ // KDE compliant startup
+ KAboutData aboutData("fsview", I18N_NOOP("FSView"), "0.1",
+ I18N_NOOP("Filesystem Viewer"),
+ KAboutData::License_GPL,
+ I18N_NOOP("(c) 2002, Josef Weidendorfer"));
+ KCmdLineArgs::init(argc, argv, &aboutData);
+ KCmdLineArgs::addCmdLineOptions(options);
+ KApplication a;
+
+ KConfigGroup gconfig(KGlobal::config(), QCString("General"));
+ QString path = gconfig.readPathEntry("Path", ".");
+
+ KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
+ if (args->count()>0) path = args->arg(0);
+
+ // TreeMap Widget as toplevel window
+ FSView w(new Inode());
+
+ QObject::connect(&w,SIGNAL(clicked(TreeMapItem*)),
+ &w,SLOT(selected(TreeMapItem*)));
+ QObject::connect(&w,SIGNAL(returnPressed(TreeMapItem*)),
+ &w,SLOT(selected(TreeMapItem*)));
+ QObject::connect(&w,
+ SIGNAL(contextMenuRequested(TreeMapItem*,const QPoint&)),
+ &w,SLOT(contextMenu(TreeMapItem*, const QPoint&)));
+
+ w.setPath(path);
+ w.show();
+
+ a.connect( &a, SIGNAL( lastWindowClosed() ), &w, SLOT( quit() ) );
+ return a.exec();
+}