summaryrefslogtreecommitdiffstats
path: root/quanta/treeviews/uploadtreefile.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/uploadtreefile.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/uploadtreefile.cpp')
-rw-r--r--quanta/treeviews/uploadtreefile.cpp89
1 files changed, 89 insertions, 0 deletions
diff --git a/quanta/treeviews/uploadtreefile.cpp b/quanta/treeviews/uploadtreefile.cpp
new file mode 100644
index 00000000..2df61f3f
--- /dev/null
+++ b/quanta/treeviews/uploadtreefile.cpp
@@ -0,0 +1,89 @@
+/***************************************************************************
+ uploadtreefile.cpp - description
+ -------------------
+ begin : Sun Aug 25 2002
+ copyright : (C) 2002, 2003 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 <qpixmap.h>
+#include <qfileinfo.h>
+
+// KDE includes
+#include <kfileitem.h>
+#include <kiconloader.h>
+#include <kurl.h>
+
+// app includes
+#include "uploadtreefile.h"
+#include "resource.h"
+
+UploadTreeFile::UploadTreeFile( UploadTreeFolder *parent, const KURL &a_url, const KFileItem &a_fileItem)
+ : KListViewItem( parent, a_url.fileName(), "", QString("%1").arg( (long int)a_fileItem.size() ), a_fileItem.timeString())
+{
+ m_url = a_url;
+ isDir = false;
+ parentFolder = parent;
+ m_fileItem = new KFileItem(a_fileItem);
+ m_confirm = false;
+
+ setWhichPixmap("check_clear");
+ setText(0, m_url.fileName());
+}
+
+UploadTreeFile::UploadTreeFile( QListView *parent, const KURL &a_url, const KFileItem &a_fileItem)
+ : KListViewItem( parent, a_url.fileName(), "", QString("%1").arg( (long int)a_fileItem.size() ), a_fileItem.timeString())
+{
+ m_url = a_url;
+ isDir = false;
+ parentFolder = 0L;
+ m_fileItem = new KFileItem(a_fileItem);
+ m_confirm = false;
+
+ //setPixmap( 1, SmallIcon("check") );
+ setWhichPixmap("check_clear");
+ setText(0, m_url.fileName());
+}
+
+
+UploadTreeFile::~UploadTreeFile()
+{
+ delete m_fileItem;
+}
+
+int UploadTreeFile::permissions()
+{
+ if (m_fileItem)
+ return m_fileItem->permissions();
+ else
+ return -1;
+}
+
+/** used for sorting */
+QString UploadTreeFile::key ( int, bool ) const
+{
+ static QString key;
+ key = QString( "1" + text(0) );
+ return key;
+// return QFileInfo(key).extension()+key;
+}
+
+void UploadTreeFile::setWhichPixmap(const QString& pixmap )
+{
+ setPixmap( 1, SmallIcon(pixmap) );
+}
+
+/** No descriptions */
+KURL UploadTreeFile::url()
+{
+ return m_url;
+}