summaryrefslogtreecommitdiffstats
path: root/quanta/treeviews/uploadtreefolder.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
commite9ae80694875f869892f13f4fcaf1170a00dea41 (patch)
treeaa2f8d8a217e2d376224c8d46b7397b68d35de2d /quanta/treeviews/uploadtreefolder.cpp
downloadtdewebdev-e9ae80694875f869892f13f4fcaf1170a00dea41.tar.gz
tdewebdev-e9ae80694875f869892f13f4fcaf1170a00dea41.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/kdewebdev@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'quanta/treeviews/uploadtreefolder.cpp')
-rw-r--r--quanta/treeviews/uploadtreefolder.cpp116
1 files changed, 116 insertions, 0 deletions
diff --git a/quanta/treeviews/uploadtreefolder.cpp b/quanta/treeviews/uploadtreefolder.cpp
new file mode 100644
index 00000000..f38e648c
--- /dev/null
+++ b/quanta/treeviews/uploadtreefolder.cpp
@@ -0,0 +1,116 @@
+/***************************************************************************
+ uploadtreefolder.cpp - description
+ -------------------
+ begin : Sun Aug 25 2002
+ copyright : (C) 2002 by Andras Mantia <[email protected]>
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; version 2 of the License. *
+ * *
+ ***************************************************************************/
+
+// QT includes
+#include <qdir.h>
+#include <qdragobject.h>
+#include <qevent.h>
+#include <qpixmap.h>
+
+// KDE includes
+#include <kiconloader.h>
+
+// app includes
+#include "uploadtreefolder.h"
+#include "uploadtreefile.h"
+#include "resource.h"
+
+UploadTreeFolder::UploadTreeFolder(const KURL &a_url, UploadTreeFolder * parent, const char * name )
+ : KListViewItem( parent, name, "", "", "" )
+{
+ parentFolder = parent;
+ m_url = a_url;
+ m_url.adjustPath(1);
+
+ setPixmap( 0, SmallIcon("folder") );
+ setPixmap( 1, SmallIcon("check") );
+ setText(0, m_url.fileName());
+
+}
+
+UploadTreeFolder::UploadTreeFolder(const KURL &a_url, QListView * parent, const char * name )
+ : KListViewItem( parent, name, "", "", "" )
+{
+ parentFolder = 0L;
+ m_url = a_url;
+ m_url.adjustPath(1);
+
+ setPixmap( 0, SmallIcon("folder") );
+ setPixmap( 1, SmallIcon("check") );
+ setText(0, m_url.fileName());
+}
+
+
+void UploadTreeFolder::setOpen( bool open )
+{
+ QListViewItem::setOpen( open );
+}
+
+/** retun full name of the folder */
+//TODO: This should go away. Use url() instead.
+QString UploadTreeFolder::fullName()
+{
+ QString s="";
+
+ if ( parentFolder )
+ {
+ s = parentFolder->fullName();
+ s += m_url.fileName()+"/";
+ }
+ else {
+ s = m_url.fileName();
+ }
+
+ return s;
+}
+
+/** setup */
+void UploadTreeFolder::setup()
+{
+ setExpandable( true );
+ QListViewItem::setup();
+}
+
+/** reload file list */
+void UploadTreeFolder::reloadList()
+{
+ setOpen( false );
+
+ QListViewItem *child;
+ while ( (child = firstChild()) )
+ removeItem( child );
+
+ setOpen( true );
+}
+
+/** need for sorting */
+QString UploadTreeFolder::key ( int, bool ) const
+{
+ static QString key;
+
+ key = QString("0") + text(0);
+
+ return key;
+}
+
+UploadTreeFolder::~UploadTreeFolder()
+{
+}
+
+void UploadTreeFolder::setWhichPixmap(const QString& pixmap )
+{
+ setPixmap( 1, SmallIcon(pixmap) );
+}
+