• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • kdepim
  • Sitemap
  • Contact Us
 

libkdepim

foldertreewidget.cpp

Go to the documentation of this file.
00001 /******************************************************************************
00002  *
00003  * This file is part of libkdepim.
00004  *
00005  * Copyright (C) 2008 Szymon Tomasz Stefanek <pragma@kvirc.net>
00006  *
00007  * This library is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU Library General Public
00009  * License as published by the Free Software Foundation; either
00010  * version 2 of the License, or (at your option) any later version.
00011  *
00012  * This library is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015  * Library General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU Library General Public License
00018  * along with this library; see the file COPYING.LIB.  If not, write to
00019  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00020  * Boston, MA 02110-1301, USA.
00021  *
00022  *****************************************************************************/
00023 
00024 #include "foldertreewidget.h"
00025 
00026 #include <QHeaderView>
00027 
00028 namespace KPIM {
00029 
00030 
00031 FolderTreeWidget::FolderTreeWidget( QWidget *parent , const char *name )
00032 : KPIM::TreeWidget( parent , name )
00033 {
00034   setAlternatingRowColors( true );
00035   setAcceptDrops( true );
00036   setAllColumnsShowFocus( true );
00037   setRootIsDecorated( true );
00038   setSortingEnabled( true );
00039   header()->setSortIndicatorShown( true );
00040   header()->setClickable( true );
00041   //setSelectionMode( Extended );
00042 }
00043 
00044 
00045 
00046 
00047 FolderTreeWidgetItem::FolderTreeWidgetItem(
00048         FolderTreeWidget *parent,
00049         const QString &label,
00050         Protocol protocol,
00051         FolderType folderType
00052     ) : QTreeWidgetItem( parent ), mProtocol(protocol), mFolderType(folderType)
00053 {
00054 }
00055 
00056 FolderTreeWidgetItem::FolderTreeWidgetItem(
00057         FolderTreeWidgetItem *parent,
00058         const QString &label,
00059         Protocol protocol,
00060         FolderType folderType,
00061         int unread,
00062         int total
00063     ) : QTreeWidgetItem( parent ), mProtocol(protocol), mFolderType(folderType)
00064 {
00065 }
00066 
00067 bool FolderTreeWidgetItem::operator < ( const QTreeWidgetItem &other ) const
00068 {
00069   int sortCol = treeWidget()->sortColumn();
00070   if ( sortCol < 0 )
00071      return true; // just "yes" :D
00072 
00073   // WIP
00074 
00075   return text(sortCol) < other.text(sortCol);
00076 }
00077 
00078 }

libkdepim

Skip menu "libkdepim"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdepim

Skip menu "kdepim"
  • akonadi
  •   clients
  •   kabc
  •   kcal
  •   kcm
  • akregator
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt
  • kdgantt1
  • kjots
  • kleopatra
  • kmail
  • kmobiletools
  • knode
  • knotes
  • kontact
  • kontactinterfaces
  • korganizer
  •   korgac
  • kpilot
  • ktimetracker
  •   doc
  • libkdepim
  • libkholidays
  • libkleo
  • libkpgp
  • maildir
Generated for kdepim by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal