summaryrefslogtreecommitdiff
path: root/libopie
Unidiff
Diffstat (limited to 'libopie') (more/less context) (show whitespace changes)
-rw-r--r--libopie/oclickablelabel.cpp2
-rw-r--r--libopie/ofileselector.cc9
-rw-r--r--libopie/ofileselector.h2
-rw-r--r--libopie/ofileselector/odefaultfactories.cpp4
-rw-r--r--libopie/ofileselector/odefaultfactories.h1
-rw-r--r--libopie/ofileselector/ofileselector.cpp3
-rw-r--r--libopie/pim/opimaccessbackend.h4
-rw-r--r--libopie/pim/opimaccesstemplate.h10
-rw-r--r--libopie/pim/orecordlist.h4
-rw-r--r--libopie/pim/otodo.cpp2
10 files changed, 18 insertions, 23 deletions
diff --git a/libopie/oclickablelabel.cpp b/libopie/oclickablelabel.cpp
index 43a0524..5768529 100644
--- a/libopie/oclickablelabel.cpp
+++ b/libopie/oclickablelabel.cpp
@@ -1,44 +1,44 @@
1#include "oclickablelabel.h" 1#include "oclickablelabel.h"
2#include <stdio.h> 2#include <stdio.h>
3 3
4OClickableLabel::OClickableLabel(QWidget* parent, 4OClickableLabel::OClickableLabel(QWidget* parent,
5 const char* name, 5 const char* name,
6 WFlags fl) : 6 WFlags fl) :
7 QLabel(parent,name,fl) 7 QLabel(parent,name,fl)
8{ 8{
9 textInverted=false; 9 textInverted=false;
10 isToggle=false; 10 isToggle=false;
11 isDown=false; 11 isDown=false;
12 showState(false); 12 showState(false);
13 setFrameShadow(Sunken); 13 setFrameShadow(Sunken);
14} 14}
15 15
16void OClickableLabel::setToggleButton(bool t) { 16void OClickableLabel::setToggleButton(bool t) {
17 isToggle=t; 17 isToggle=t;
18} 18}
19 19
20void OClickableLabel::mousePressEvent( QMouseEvent *e ) { 20void OClickableLabel::mousePressEvent( QMouseEvent * /*e*/ ) {
21 if (isToggle && isDown) { 21 if (isToggle && isDown) {
22 showState(false); 22 showState(false);
23 } else { 23 } else {
24 showState(true); 24 showState(true);
25 } 25 }
26} 26}
27 27
28void OClickableLabel::mouseReleaseEvent( QMouseEvent *e ) { 28void OClickableLabel::mouseReleaseEvent( QMouseEvent *e ) {
29 if (rect().contains(e->pos()) && isToggle) isDown=!isDown; 29 if (rect().contains(e->pos()) && isToggle) isDown=!isDown;
30 30
31 if (isToggle && isDown) { 31 if (isToggle && isDown) {
32 showState(true); 32 showState(true);
33 } else { 33 } else {
34 showState(false); 34 showState(false);
35 } 35 }
36 36
37 if (rect().contains(e->pos())) { 37 if (rect().contains(e->pos())) {
38 if (isToggle) { 38 if (isToggle) {
39 emit toggled(isDown); 39 emit toggled(isDown);
40 } 40 }
41 emit clicked(); 41 emit clicked();
42 } 42 }
43} 43}
44 44
diff --git a/libopie/ofileselector.cc b/libopie/ofileselector.cc
index 9534667..6a6a300 100644
--- a/libopie/ofileselector.cc
+++ b/libopie/ofileselector.cc
@@ -354,49 +354,49 @@ QStringList OFileSelector::selectedNames()const
354QString OFileSelector::selectedPath()const 354QString OFileSelector::selectedPath()const
355{ 355{
356 QString path; 356 QString path;
357 if( m_selector == NORMAL ){ 357 if( m_selector == NORMAL ){
358 path = QPEApplication::documentDir(); 358 path = QPEApplication::documentDir();
359 }else if( m_selector == EXTENDED || m_selector == EXTENDED_ALL ){ 359 }else if( m_selector == EXTENDED || m_selector == EXTENDED_ALL ){
360 ; 360 ;
361 } 361 }
362 return path; 362 return path;
363} 363}
364QStringList OFileSelector::selectedPaths() const 364QStringList OFileSelector::selectedPaths() const
365{ 365{
366 QStringList list; 366 QStringList list;
367 list << selectedPath(); 367 list << selectedPath();
368 return list; 368 return list;
369} 369}
370QString OFileSelector::directory()const 370QString OFileSelector::directory()const
371{ 371{
372 if( m_selector == NORMAL ) 372 if( m_selector == NORMAL )
373 return QPEApplication::documentDir(); 373 return QPEApplication::documentDir();
374 374
375 return QDir(m_currentDir).absPath(); 375 return QDir(m_currentDir).absPath();
376} 376}
377 377
378int OFileSelector::fileCount() 378int OFileSelector::fileCount() const
379{ 379{
380 int count; 380 int count;
381 switch( m_selector ){ 381 switch( m_selector ){
382 case NORMAL: 382 case NORMAL:
383 count = m_select->fileCount(); 383 count = m_select->fileCount();
384 break; 384 break;
385 //case CUSTOM: 385 //case CUSTOM:
386 case EXTENDED: 386 case EXTENDED:
387 case EXTENDED_ALL: 387 case EXTENDED_ALL:
388 default: 388 default:
389 count = m_View->childCount(); 389 count = m_View->childCount();
390 break; 390 break;
391 } 391 }
392 return count; 392 return count;
393} 393}
394DocLnk OFileSelector::selectedDocument() const 394DocLnk OFileSelector::selectedDocument() const
395{ 395{
396 DocLnk lnk; 396 DocLnk lnk;
397 switch( m_selector ){ 397 switch( m_selector ){
398 case NORMAL:{ 398 case NORMAL:{
399 lnk = m_select->selectedDocument(); 399 lnk = m_select->selectedDocument();
400 break; 400 break;
401 } 401 }
402 case EXTENDED: 402 case EXTENDED:
@@ -661,81 +661,81 @@ void OFileSelector::initVars()
661 m_docButton = 0; 661 m_docButton = 0;
662 m_hideButton = 0; 662 m_hideButton = 0;
663 m_ok = 0; 663 m_ok = 0;
664 m_cancel = 0; 664 m_cancel = 0;
665 m_reread = 0; 665 m_reread = 0;
666 m_up = 0; 666 m_up = 0;
667 m_View = 0; 667 m_View = 0;
668 m_checkPerm = 0; 668 m_checkPerm = 0;
669 m_pseudo = 0; 669 m_pseudo = 0;
670 m_pseudoLayout = 0; 670 m_pseudoLayout = 0;
671 m_select = 0; 671 m_select = 0;
672 m_stack = 0; 672 m_stack = 0;
673 m_lay = 0; 673 m_lay = 0;
674 m_Oselector = 0; 674 m_Oselector = 0;
675 m_boxToolbar = 0; 675 m_boxToolbar = 0;
676 m_boxOk = 0; 676 m_boxOk = 0;
677 m_boxName = 0; 677 m_boxName = 0;
678 m_boxView = 0; 678 m_boxView = 0;
679 m_custom = 0; 679 m_custom = 0;
680 m_edit = 0; 680 m_edit = 0;
681 m_fnLabel = 0; 681 m_fnLabel = 0;
682 m_new = 0; 682 m_new = 0;
683 m_close = 0; 683 m_close = 0;
684} 684}
685void OFileSelector::addFile(const QString &mime, QFileInfo *info, bool symlink) 685void OFileSelector::addFile(const QString &/*mime*/, QFileInfo *info, bool symlink)
686{ 686{
687 if(!m_files) 687 if(!m_files)
688 return; 688 return;
689 // if( !compliesMime(info->absFilePath(), mime ) ) 689 // if( !compliesMime(info->absFilePath(), mime ) )
690 // return; 690 // return;
691 MimeType type( info->absFilePath() ); 691 MimeType type( info->absFilePath() );
692 if (!compliesMime( type.id() ) ) 692 if (!compliesMime( type.id() ) )
693 return; 693 return;
694 694
695 QPixmap pix = type.pixmap(); 695 QPixmap pix = type.pixmap();
696 QString dir; 696 QString dir;
697 QString name; 697 QString name;
698 bool locked; 698 bool locked;
699 if( pix.isNull() ) 699 if( pix.isNull() )
700 pix = Resource::loadPixmap( "UnknownDocument-14"); 700 pix = Resource::loadPixmap( "UnknownDocument-14");
701 dir = info->dirPath( true ); 701 dir = info->dirPath( true );
702 if( symlink ) 702 if( symlink )
703 name = info->fileName() + " -> " +info->dirPath() + "/" + info->readLink(); 703 name = info->fileName() + " -> " +info->dirPath() + "/" + info->readLink();
704 else { 704 else {
705 name = info->fileName(); 705 name = info->fileName();
706 if( ( m_mode == OPEN && !info->isReadable() )|| 706 if( ( m_mode == OPEN && !info->isReadable() )||
707 ( m_mode == SAVE && !info->isWritable() ) ){ 707 ( m_mode == SAVE && !info->isWritable() ) ){
708 708
709 locked = true; pix = Resource::loadPixmap("locked"); 709 locked = true; pix = Resource::loadPixmap("locked");
710 } 710 }
711 } 711 }
712 new OFileSelectorItem( m_View, pix, name, 712 new OFileSelectorItem( m_View, pix, name,
713 info->lastModified().toString(), 713 info->lastModified().toString(),
714 QString::number( info->size() ), 714 QString::number( info->size() ),
715 dir, locked ); 715 dir, locked );
716} 716}
717void OFileSelector::addDir(const QString &mime, QFileInfo *info, bool symlink ) 717void OFileSelector::addDir(const QString &/*mime*/, QFileInfo *info, bool symlink )
718{ 718{
719 if(!m_dir) 719 if(!m_dir)
720 return; 720 return;
721 if( m_selector == EXTENDED_ALL || m_selector == EXTENDED ){ 721 if( m_selector == EXTENDED_ALL || m_selector == EXTENDED ){
722 bool locked = false; 722 bool locked = false;
723 QString name; 723 QString name;
724 QPixmap pix; 724 QPixmap pix;
725 if( ( m_mode == OPEN && !info->isReadable() ) || ( m_mode == SAVE && !info->isWritable() ) ){ 725 if( ( m_mode == OPEN && !info->isReadable() ) || ( m_mode == SAVE && !info->isWritable() ) ){
726 locked = true; 726 locked = true;
727 if( symlink ) 727 if( symlink )
728 pix = (*m_pixmaps)["symlinkedlocked"]; 728 pix = (*m_pixmaps)["symlinkedlocked"];
729 else 729 else
730 pix = Resource::loadPixmap("lockedfolder"); 730 pix = Resource::loadPixmap("lockedfolder");
731 }else { // readable 731 }else { // readable
732 pix = symlink ? (*m_pixmaps)["dirsymlink"] : Resource::loadPixmap("folder") ; 732 pix = symlink ? (*m_pixmaps)["dirsymlink"] : Resource::loadPixmap("folder") ;
733 } 733 }
734 name = symlink ? info->fileName() + "->" + info->dirPath(true) + "/" +info->readLink() : info->fileName() ; 734 name = symlink ? info->fileName() + "->" + info->dirPath(true) + "/" +info->readLink() : info->fileName() ;
735 new OFileSelectorItem( m_View, pix, name, 735 new OFileSelectorItem( m_View, pix, name,
736 info->lastModified().toString(), 736 info->lastModified().toString(),
737 QString::number( info->size() ), 737 QString::number( info->size() ),
738 info->dirPath( true ), locked, 738 info->dirPath( true ), locked,
739 true ); 739 true );
740 740
741 }// else CUSTOM View 741 }// else CUSTOM View
@@ -997,49 +997,48 @@ bool OFileSelector::compliesMime( const QString& mime ) {
997 997
998 qWarning("current text is %s", currentText.latin1() ); 998 qWarning("current text is %s", currentText.latin1() );
999 QMap<QString, QStringList>::Iterator it; 999 QMap<QString, QStringList>::Iterator it;
1000 QStringList list; 1000 QStringList list;
1001 if ( currentText == tr("All") ) return true; 1001 if ( currentText == tr("All") ) return true;
1002 else if ( currentText.isEmpty() && !m_mimetypes.isEmpty() ) { 1002 else if ( currentText.isEmpty() && !m_mimetypes.isEmpty() ) {
1003 it = m_mimetypes.begin(); 1003 it = m_mimetypes.begin();
1004 list = it.data(); 1004 list = it.data();
1005 }else if ( currentText.isEmpty() ) return true; 1005 }else if ( currentText.isEmpty() ) return true;
1006 else{ 1006 else{
1007 it = m_mimetypes.find(currentText ); 1007 it = m_mimetypes.find(currentText );
1008 if ( it == m_mimetypes.end() ) qWarning("not there"), list << currentText; 1008 if ( it == m_mimetypes.end() ) qWarning("not there"), list << currentText;
1009 else qWarning("found"), list = it.data(); 1009 else qWarning("found"), list = it.data();
1010 } 1010 }
1011 // dump it now 1011 // dump it now
1012 //for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) { 1012 //for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) {
1013 // qWarning( "%s", (*it).latin1() ); 1013 // qWarning( "%s", (*it).latin1() );
1014 //} 1014 //}
1015 1015
1016 1016
1017 if ( list.contains(mime) ) return true; 1017 if ( list.contains(mime) ) return true;
1018 qWarning("list doesn't contain it "); 1018 qWarning("list doesn't contain it ");
1019 QStringList::Iterator it2; 1019 QStringList::Iterator it2;
1020 int pos; 1020 int pos;
1021 int pos2;
1022 for ( it2 = list.begin(); it2 != list.end(); ++it2 ) { 1021 for ( it2 = list.begin(); it2 != list.end(); ++it2 ) {
1023 pos = (*it2).findRev("/*"); 1022 pos = (*it2).findRev("/*");
1024 if ( pos >= 0 ) { 1023 if ( pos >= 0 ) {
1025 if ( mime.contains( (*it2).left(pos) ) ) return true; 1024 if ( mime.contains( (*it2).left(pos) ) ) return true;
1026 } 1025 }
1027 } 1026 }
1028 return false; 1027 return false;
1029} 1028}
1030void OFileSelector::slotFileSelected( const QString &string ) 1029void OFileSelector::slotFileSelected( const QString &string )
1031{ 1030{
1032 if( m_shLne ) 1031 if( m_shLne )
1033 m_edit->setText( string ); 1032 m_edit->setText( string );
1034 emit fileSelected( string ); 1033 emit fileSelected( string );
1035} 1034}
1036void OFileSelector::slotFileBridgeSelected( const DocLnk &lnk ) 1035void OFileSelector::slotFileBridgeSelected( const DocLnk &lnk )
1037{ 1036{
1038 slotFileSelected( lnk.name() ); 1037 slotFileSelected( lnk.name() );
1039 emit fileSelected( lnk ); 1038 emit fileSelected( lnk );
1040} 1039}
1041void OFileSelector::slotSelectionChanged() 1040void OFileSelector::slotSelectionChanged()
1042{ 1041{
1043 1042
1044} 1043}
1045void OFileSelector::slotCurrentChanged(QListViewItem* item ) 1044void OFileSelector::slotCurrentChanged(QListViewItem* item )
@@ -1084,49 +1083,49 @@ void OFileSelector::slotClicked( int button, QListViewItem *item, const QPoint &
1084 // if MODE Dir m_shLne set the Text 1083 // if MODE Dir m_shLne set the Text
1085 }else{ 1084 }else{
1086 if( m_shLne ) 1085 if( m_shLne )
1087 m_edit->setText( str[0].stripWhiteSpace() ); 1086 m_edit->setText( str[0].stripWhiteSpace() );
1088 qWarning("selected here in slot clicked"); 1087 qWarning("selected here in slot clicked");
1089 emit fileSelected( sel->directory() + "/" + str[0].stripWhiteSpace() ); 1088 emit fileSelected( sel->directory() + "/" + str[0].stripWhiteSpace() );
1090 DocLnk lnk( sel->directory() + "/" + str[0].stripWhiteSpace() ); 1089 DocLnk lnk( sel->directory() + "/" + str[0].stripWhiteSpace() );
1091 qWarning("file selected"); 1090 qWarning("file selected");
1092 emit fileSelected( lnk ); 1091 emit fileSelected( lnk );
1093 } 1092 }
1094 } 1093 }
1095 break; 1094 break;
1096 } 1095 }
1097 } 1096 }
1098} 1097}
1099void OFileSelector::slotRightButton(int button, QListViewItem *item, const QPoint &, int ) 1098void OFileSelector::slotRightButton(int button, QListViewItem *item, const QPoint &, int )
1100{ 1099{
1101 if( item == 0 ) 1100 if( item == 0 )
1102 return; 1101 return;
1103 1102
1104 if( button != Qt::RightButton ) 1103 if( button != Qt::RightButton )
1105 return; 1104 return;
1106 slotContextMenu( item ); 1105 slotContextMenu( item );
1107} 1106}
1108void OFileSelector::slotContextMenu( QListViewItem *item) 1107void OFileSelector::slotContextMenu( QListViewItem * /*item*/)
1109{ 1108{
1110 1109
1111} 1110}
1112void OFileSelector::slotChangedDir() 1111void OFileSelector::slotChangedDir()
1113{ 1112{
1114 OFileSelectorItem *sel = (OFileSelectorItem*)m_View->currentItem(); 1113 OFileSelectorItem *sel = (OFileSelectorItem*)m_View->currentItem();
1115 if(sel->isDir() ){ 1114 if(sel->isDir() ){
1116 QStringList str = QStringList::split("->", sel->text(1) ); 1115 QStringList str = QStringList::split("->", sel->text(1) );
1117 cd( sel->directory() + "/" + str[0].stripWhiteSpace() ); 1116 cd( sel->directory() + "/" + str[0].stripWhiteSpace() );
1118 } 1117 }
1119} 1118}
1120void OFileSelector::slotOpen() 1119void OFileSelector::slotOpen()
1121{ 1120{
1122 OFileSelectorItem *sel = (OFileSelectorItem*)m_View->currentItem(); 1121 OFileSelectorItem *sel = (OFileSelectorItem*)m_View->currentItem();
1123 if(!sel->isDir() ){ 1122 if(!sel->isDir() ){
1124 QStringList str = QStringList::split("->", sel->text(1) ); 1123 QStringList str = QStringList::split("->", sel->text(1) );
1125 slotFileSelected( sel->directory() +"/" +str[0].stripWhiteSpace() ); 1124 slotFileSelected( sel->directory() +"/" +str[0].stripWhiteSpace() );
1126 qWarning("slot open"); 1125 qWarning("slot open");
1127 // DocLnk lnk( sel->directory() + "/" + str[0].stripWhiteSpace() ); 1126 // DocLnk lnk( sel->directory() + "/" + str[0].stripWhiteSpace() );
1128 //emit fileSelected( lnk ); 1127 //emit fileSelected( lnk );
1129 } 1128 }
1130} 1129}
1131void OFileSelector::slotRescan() 1130void OFileSelector::slotRescan()
1132{ 1131{
diff --git a/libopie/ofileselector.h b/libopie/ofileselector.h
index f2d5f84..17c494e 100644
--- a/libopie/ofileselector.h
+++ b/libopie/ofileselector.h
@@ -159,49 +159,49 @@ class OFileSelector : public QWidget {
159 bool showFiles()const { return m_files; }; 159 bool showFiles()const { return m_files; };
160 void setShowFiles(bool ); 160 void setShowFiles(bool );
161 bool cd(const QString &path ); 161 bool cd(const QString &path );
162 162
163 163
164 int mode()const { return m_mode; }; 164 int mode()const { return m_mode; };
165 int selector()const { return m_selector; }; 165 int selector()const { return m_selector; };
166 void setSelector( int ); 166 void setSelector( int );
167 167
168 bool showPopup()const { return m_showPopup; }; 168 bool showPopup()const { return m_showPopup; };
169 void setShowPopup( bool pop ) { m_showPopup = pop; }; 169 void setShowPopup( bool pop ) { m_showPopup = pop; };
170 void setPopupMenu( QPopupMenu * ); 170 void setPopupMenu( QPopupMenu * );
171 171
172 // void updateLay(); 172 // void updateLay();
173 173
174 void reparse(); // re reads the dir 174 void reparse(); // re reads the dir
175 175
176 QString selectedName( )const; 176 QString selectedName( )const;
177 QStringList selectedNames()const; 177 QStringList selectedNames()const;
178 178
179 QString selectedPath() const; 179 QString selectedPath() const;
180 QStringList selectedPaths() const; 180 QStringList selectedPaths() const;
181 181
182 QString directory()const; 182 QString directory()const;
183 int fileCount(); 183 int fileCount() const;
184 184
185 /* the user needs to delete it */ 185 /* the user needs to delete it */
186 DocLnk selectedDocument()const; 186 DocLnk selectedDocument()const;
187 /* the user needs to delete it */ 187 /* the user needs to delete it */
188 QValueList<DocLnk> selectedDocuments()const; 188 QValueList<DocLnk> selectedDocuments()const;
189 189
190 signals: 190 signals:
191 void fileSelected( const DocLnk & ); 191 void fileSelected( const DocLnk & );
192 void fileSelected( const QString & ); 192 void fileSelected( const QString & );
193 void dirSelected(const QString &dir ); 193 void dirSelected(const QString &dir );
194 void closeMe(); 194 void closeMe();
195 void ok(); 195 void ok();
196 void cancel(); 196 void cancel();
197 void contextMenu(); 197 void contextMenu();
198 198
199 private slots: 199 private slots:
200 void slotTest() { qWarning("slotTest" ); setLineEditVisible(false ); }; 200 void slotTest() { qWarning("slotTest" ); setLineEditVisible(false ); };
201 void slotOk(); 201 void slotOk();
202 void slotCancel(); 202 void slotCancel();
203 void slotViewCheck(const QString & ); 203 void slotViewCheck(const QString & );
204 void slotMimeCheck(const QString & ); 204 void slotMimeCheck(const QString & );
205 void slotLocationActivated(const QString & ); 205 void slotLocationActivated(const QString & );
206 void slotInsertLocationPath(const QString &, int); 206 void slotInsertLocationPath(const QString &, int);
207 void locationComboChanged(); 207 void locationComboChanged();
diff --git a/libopie/ofileselector/odefaultfactories.cpp b/libopie/ofileselector/odefaultfactories.cpp
index c8efffb..2f8ef9b 100644
--- a/libopie/ofileselector/odefaultfactories.cpp
+++ b/libopie/ofileselector/odefaultfactories.cpp
@@ -1,23 +1,19 @@
1#include "ofilelistview.h" 1#include "ofilelistview.h"
2#include "ofileiconview.h"
3#include "olocallister.h" 2#include "olocallister.h"
4 3
5 4
6#include "odefaultfactories.h" 5#include "odefaultfactories.h"
7 6
8extern "C" { 7extern "C" {
9 8
10 9
11 OFileView* newFileIconView( OFileSelector* sel, QWidget* parent ) {
12 return new OFileIconView( parent, sel );
13 }
14 10
15 OFileView* newFileListView( OFileSelector* sel, QWidget* par ) { 11 OFileView* newFileListView( OFileSelector* sel, QWidget* par ) {
16 return new OFileListView(par, sel ); 12 return new OFileListView(par, sel );
17 } 13 }
18 14
19 OLister* newLocalLister( OFileSelector* sel) { 15 OLister* newLocalLister( OFileSelector* sel) {
20 return new OLocalLister( sel ); 16 return new OLocalLister( sel );
21 } 17 }
22 18
23}; 19};
diff --git a/libopie/ofileselector/odefaultfactories.h b/libopie/ofileselector/odefaultfactories.h
index b4c35af..0cc90e5 100644
--- a/libopie/ofileselector/odefaultfactories.h
+++ b/libopie/ofileselector/odefaultfactories.h
@@ -1,17 +1,16 @@
1#ifndef OPIE_DEFAULT_FACTORIES_H 1#ifndef OPIE_DEFAULT_FACTORIES_H
2#define OPIE_DEFAULT_FACTORIES_H 2#define OPIE_DEFAULT_FACTORIES_H
3 3
4#include "ofilefactory.h" 4#include "ofilefactory.h"
5 5
6extern "C" { 6extern "C" {
7 7
8 OFileView* newFileIconView( OFileSelector*, QWidget* parent );
9 OFileView* newFileListView( OFileSelector*, QWidget* parent ); 8 OFileView* newFileListView( OFileSelector*, QWidget* parent );
10 9
11 OLister* newLocalLister(OFileSelector* ); 10 OLister* newLocalLister(OFileSelector* );
12 11
13 12
14}; 13};
15 14
16 15
17#endif 16#endif
diff --git a/libopie/ofileselector/ofileselector.cpp b/libopie/ofileselector/ofileselector.cpp
index c6e923f..abc2889 100644
--- a/libopie/ofileselector/ofileselector.cpp
+++ b/libopie/ofileselector/ofileselector.cpp
@@ -955,49 +955,50 @@ void OFileSelector::setView( const QString& lis ) {
955 delete m_select; 955 delete m_select;
956 m_lister =0l; 956 m_lister =0l;
957 m_fileView = 0l; 957 m_fileView = 0l;
958 m_select = 0l; 958 m_select = 0l;
959 if ( lis.startsWith("All") ) { 959 if ( lis.startsWith("All") ) {
960 m_selector = ExtendedAll; 960 m_selector = ExtendedAll;
961 list = lis.mid(4 ).stripWhiteSpace(); 961 list = lis.mid(4 ).stripWhiteSpace();
962 } else{ 962 } else{
963 list = lis; 963 list = lis;
964 m_selector = Extended; 964 m_selector = Extended;
965 } 965 }
966 setLister(m_listerName); 966 setLister(m_listerName);
967 m_fileView = factory()->view( list, this, m_mainView ); 967 m_fileView = factory()->view( list, this, m_mainView );
968 m_mainView->setWidget( m_fileView->widget() ); 968 m_mainView->setWidget( m_fileView->widget() );
969 reparse(); 969 reparse();
970 } 970 }
971} 971}
972/* 972/*
973 * the factory 973 * the factory
974 */ 974 */
975void OFileSelector::initFactory() { 975void OFileSelector::initFactory() {
976 m_fileFactory = new OFileFactory(); 976 m_fileFactory = new OFileFactory();
977 m_fileFactory->addLister(tr("Files"), newLocalLister ); 977 m_fileFactory->addLister(tr("Files"), newLocalLister );
978 m_fileFactory->addView(tr("List View"), newFileListView ); 978 m_fileFactory->addView(tr("List View"), newFileListView );
979 m_fileFactory->addView(tr("Documents"), newFileIconView ); 979 /* dummy entry */
980 m_fileFactory->addView(tr("Documents"), newFileListView );
980} 981}
981 982
982void OFileSelector::fillList() { 983void OFileSelector::fillList() {
983 qWarning("fill list"); 984 qWarning("fill list");
984 if (!m_viewCheck ) 985 if (!m_viewCheck )
985 return; 986 return;
986 987
987 m_viewCheck->clear(); 988 m_viewCheck->clear();
988 QStringList list = factory()->views(); 989 QStringList list = factory()->views();
989 qWarning("views: " + list.join(";") ); 990 qWarning("views: " + list.join(";") );
990 for (QStringList::Iterator it = list.begin(); it != list.end(); ++it ) { 991 for (QStringList::Iterator it = list.begin(); it != list.end(); ++it ) {
991 qWarning( (*it) ); 992 qWarning( (*it) );
992 if ( (*it) == tr("Documents") ) { 993 if ( (*it) == tr("Documents") ) {
993 m_viewCheck->insertItem( (*it) ); 994 m_viewCheck->insertItem( (*it) );
994 }else{ 995 }else{
995 m_viewCheck->insertItem( (*it) ); 996 m_viewCheck->insertItem( (*it) );
996 m_viewCheck->insertItem( tr("All ") + (*it) ); 997 m_viewCheck->insertItem( tr("All ") + (*it) );
997 } 998 }
998 } 999 }
999} 1000}
1000OFileFactory* OFileSelector::factory() { 1001OFileFactory* OFileSelector::factory() {
1001 return m_fileFactory; 1002 return m_fileFactory;
1002} 1003}
1003 1004
diff --git a/libopie/pim/opimaccessbackend.h b/libopie/pim/opimaccessbackend.h
index 0bd2723..4f00bc9 100644
--- a/libopie/pim/opimaccessbackend.h
+++ b/libopie/pim/opimaccessbackend.h
@@ -36,49 +36,49 @@ public:
36 * save the resource and 36 * save the resource and
37 * all it's changes 37 * all it's changes
38 */ 38 */
39 virtual bool save() = 0; 39 virtual bool save() = 0;
40 40
41 /** 41 /**
42 * return an array of 42 * return an array of
43 * all available uids 43 * all available uids
44 */ 44 */
45 virtual QArray<int> allRecords()const = 0; 45 virtual QArray<int> allRecords()const = 0;
46 46
47 /** 47 /**
48 * queryByExample for T with the SortOrder 48 * queryByExample for T with the SortOrder
49 * sort 49 * sort
50 */ 50 */
51 virtual QArray<int> queryByExample( const T& t, int sort ) = 0; 51 virtual QArray<int> queryByExample( const T& t, int sort ) = 0;
52 52
53 /** 53 /**
54 * find the OPimRecord with uid @param uid 54 * find the OPimRecord with uid @param uid
55 * returns T and T.isEmpty() if nothing was found 55 * returns T and T.isEmpty() if nothing was found
56 */ 56 */
57 virtual T find(int uid )const = 0; 57 virtual T find(int uid )const = 0;
58 58
59 virtual T find(int uid, const QArray<int>& items, 59 virtual T find(int uid, const QArray<int>& items,
60 uint current, Frontend::CacheDirection )const ; 60 uint current, typename Frontend::CacheDirection )const ;
61 /** 61 /**
62 * clear the back end 62 * clear the back end
63 */ 63 */
64 virtual void clear() = 0; 64 virtual void clear() = 0;
65 65
66 /** 66 /**
67 * add T 67 * add T
68 */ 68 */
69 virtual bool add( const T& t ) = 0; 69 virtual bool add( const T& t ) = 0;
70 70
71 /** 71 /**
72 * remove 72 * remove
73 */ 73 */
74 virtual bool remove( int uid ) = 0; 74 virtual bool remove( int uid ) = 0;
75 75
76 /** 76 /**
77 * replace a record with T.uid() 77 * replace a record with T.uid()
78 */ 78 */
79 virtual bool replace( const T& t ) = 0; 79 virtual bool replace( const T& t ) = 0;
80 80
81 /* 81 /*
82 * setTheFrontEnd!!! 82 * setTheFrontEnd!!!
83 */ 83 */
84 void setFrontend( Frontend* front ); 84 void setFrontend( Frontend* front );
@@ -106,36 +106,36 @@ private:
106template <class T> 106template <class T>
107OPimAccessBackend<T>::OPimAccessBackend() { 107OPimAccessBackend<T>::OPimAccessBackend() {
108 m_front = 0l; 108 m_front = 0l;
109} 109}
110template <class T> 110template <class T>
111OPimAccessBackend<T>::~OPimAccessBackend() { 111OPimAccessBackend<T>::~OPimAccessBackend() {
112 112
113} 113}
114template <class T> 114template <class T>
115void OPimAccessBackend<T>::setFrontend( Frontend* fr ) { 115void OPimAccessBackend<T>::setFrontend( Frontend* fr ) {
116 m_front = fr; 116 m_front = fr;
117} 117}
118template <class T> 118template <class T>
119void OPimAccessBackend<T>::cache( const T& t )const { 119void OPimAccessBackend<T>::cache( const T& t )const {
120 if (m_front ) 120 if (m_front )
121 m_front->cache( t ); 121 m_front->cache( t );
122} 122}
123template <class T> 123template <class T>
124void OPimAccessBackend<T>::setSaneCacheSize( int size) { 124void OPimAccessBackend<T>::setSaneCacheSize( int size) {
125 if (m_front ) 125 if (m_front )
126 m_front->setSaneCacheSize( size ); 126 m_front->setSaneCacheSize( size );
127} 127}
128template <class T> 128template <class T>
129T OPimAccessBackend<T>::find( int uid, const QArray<int>&, 129T OPimAccessBackend<T>::find( int uid, const QArray<int>&,
130 uint, Frontend::CacheDirection )const { 130 uint, typename Frontend::CacheDirection )const {
131 return find( uid ); 131 return find( uid );
132} 132}
133template <class T> 133template <class T>
134void OPimAccessBackend<T>::setReadAhead( uint count ) { 134void OPimAccessBackend<T>::setReadAhead( uint count ) {
135 m_read = count; 135 m_read = count;
136} 136}
137template <class T> 137template <class T>
138uint OPimAccessBackend<T>::readAhead()const { 138uint OPimAccessBackend<T>::readAhead()const {
139 return m_read; 139 return m_read;
140} 140}
141#endif 141#endif
diff --git a/libopie/pim/opimaccesstemplate.h b/libopie/pim/opimaccesstemplate.h
index c5523a8..6de68b1 100644
--- a/libopie/pim/opimaccesstemplate.h
+++ b/libopie/pim/opimaccesstemplate.h
@@ -58,49 +58,49 @@ public:
58 */ 58 */
59 bool wasChangedExternally()const; 59 bool wasChangedExternally()const;
60 60
61 /** 61 /**
62 * return a List of records 62 * return a List of records
63 * you can iterate over them 63 * you can iterate over them
64 */ 64 */
65 virtual List allRecords()const; 65 virtual List allRecords()const;
66 66
67 /** 67 /**
68 * queryByExample. 68 * queryByExample.
69 * @see otodoaccess, ocontactaccess 69 * @see otodoaccess, ocontactaccess
70 */ 70 */
71 virtual List queryByExample( const T& t, int querySettings ); 71 virtual List queryByExample( const T& t, int querySettings );
72 72
73 /** 73 /**
74 * find the OPimRecord uid 74 * find the OPimRecord uid
75 */ 75 */
76 virtual T find( int uid )const; 76 virtual T find( int uid )const;
77 77
78 /** 78 /**
79 * read ahead cache find method ;) 79 * read ahead cache find method ;)
80 */ 80 */
81 virtual T find( int uid, const QArray<int>&, 81 virtual T find( int uid, const QArray<int>&,
82 uint current, CacheDirection dir = Forward )const; 82 uint current, typename OTemplateBase<T>::CacheDirection dir = OTemplateBase<T>::Forward )const;
83 83
84 /* invalidate cache here */ 84 /* invalidate cache here */
85 /** 85 /**
86 * clears the backend and invalidates the backend 86 * clears the backend and invalidates the backend
87 */ 87 */
88 virtual void clear() ; 88 virtual void clear() ;
89 89
90 /** 90 /**
91 * add T to the backend 91 * add T to the backend
92 * @param t The item to add. 92 * @param t The item to add.
93 * @return <i>true</i> if added successfully. 93 * @return <i>true</i> if added successfully.
94 */ 94 */
95 virtual bool add( const T& t ) ; 95 virtual bool add( const T& t ) ;
96 96
97 /* only the uid matters */ 97 /* only the uid matters */
98 /** 98 /**
99 * remove T from the backend 99 * remove T from the backend
100 * @param t The item to remove 100 * @param t The item to remove
101 * @return <i>true</i> if successful. 101 * @return <i>true</i> if successful.
102 */ 102 */
103 virtual bool remove( const T& t ); 103 virtual bool remove( const T& t );
104 104
105 /** 105 /**
106 * remove the OPimRecord with uid 106 * remove the OPimRecord with uid
@@ -144,114 +144,114 @@ OPimAccessTemplate<T>::OPimAccessTemplate( BackEnd* end )
144{ 144{
145 if (end ) 145 if (end )
146 end->setFrontend( this ); 146 end->setFrontend( this );
147} 147}
148template <class T> 148template <class T>
149OPimAccessTemplate<T>::~OPimAccessTemplate() { 149OPimAccessTemplate<T>::~OPimAccessTemplate() {
150 qWarning("~OPimAccessTemplate<T>"); 150 qWarning("~OPimAccessTemplate<T>");
151 delete m_backEnd; 151 delete m_backEnd;
152} 152}
153template <class T> 153template <class T>
154bool OPimAccessTemplate<T>::load() { 154bool OPimAccessTemplate<T>::load() {
155 invalidateCache(); 155 invalidateCache();
156 return m_backEnd->load(); 156 return m_backEnd->load();
157} 157}
158template <class T> 158template <class T>
159bool OPimAccessTemplate<T>::reload() { 159bool OPimAccessTemplate<T>::reload() {
160 invalidateCache(); // zecke: I think this should be added (se) 160 invalidateCache(); // zecke: I think this should be added (se)
161 return m_backEnd->reload(); 161 return m_backEnd->reload();
162} 162}
163template <class T> 163template <class T>
164bool OPimAccessTemplate<T>::save() { 164bool OPimAccessTemplate<T>::save() {
165 return m_backEnd->save(); 165 return m_backEnd->save();
166} 166}
167template <class T> 167template <class T>
168OPimAccessTemplate<T>::List OPimAccessTemplate<T>::allRecords()const { 168typename OPimAccessTemplate<T>::List OPimAccessTemplate<T>::allRecords()const {
169 QArray<int> ints = m_backEnd->allRecords(); 169 QArray<int> ints = m_backEnd->allRecords();
170 List lis(ints, this ); 170 List lis(ints, this );
171 return lis; 171 return lis;
172} 172}
173template <class T> 173template <class T>
174OPimAccessTemplate<T>::List 174typename OPimAccessTemplate<T>::List
175OPimAccessTemplate<T>::queryByExample( const T& t, int sortOrder ) { 175OPimAccessTemplate<T>::queryByExample( const T& t, int sortOrder ) {
176 QArray<int> ints = m_backEnd->queryByExample( t, sortOrder ); 176 QArray<int> ints = m_backEnd->queryByExample( t, sortOrder );
177 177
178 List lis(ints, this ); 178 List lis(ints, this );
179 return lis; 179 return lis;
180} 180}
181template <class T> 181template <class T>
182T OPimAccessTemplate<T>::find( int uid ) const{ 182T OPimAccessTemplate<T>::find( int uid ) const{
183 T t = m_backEnd->find( uid ); 183 T t = m_backEnd->find( uid );
184 cache( t ); 184 cache( t );
185 return t; 185 return t;
186} 186}
187template <class T> 187template <class T>
188T OPimAccessTemplate<T>::find( int uid, const QArray<int>& ar, 188T OPimAccessTemplate<T>::find( int uid, const QArray<int>& ar,
189 uint current, CacheDirection dir )const { 189 uint current, typename OTemplateBase<T>::CacheDirection dir )const {
190 /* 190 /*
191 * better do T.isEmpty() 191 * better do T.isEmpty()
192 * after a find this way we would 192 * after a find this way we would
193 * avoid two finds in QCache... 193 * avoid two finds in QCache...
194 */ 194 */
195 // qWarning("find it now %d", uid ); 195 // qWarning("find it now %d", uid );
196 if (m_cache.contains( uid ) ) { 196 if (m_cache.contains( uid ) ) {
197 return m_cache.find( uid ); 197 return m_cache.find( uid );
198 } 198 }
199 199
200 T t = m_backEnd->find( uid, ar, current, dir ); 200 T t = m_backEnd->find( uid, ar, current, dir );
201 cache( t ); 201 cache( t );
202 return t; 202 return t;
203} 203}
204template <class T> 204template <class T>
205void OPimAccessTemplate<T>::clear() { 205void OPimAccessTemplate<T>::clear() {
206 invalidateCache(); 206 invalidateCache();
207 m_backEnd->clear(); 207 m_backEnd->clear();
208} 208}
209template <class T> 209template <class T>
210bool OPimAccessTemplate<T>::add( const T& t ) { 210bool OPimAccessTemplate<T>::add( const T& t ) {
211 cache( t ); 211 cache( t );
212 return m_backEnd->add( t ); 212 return m_backEnd->add( t );
213} 213}
214template <class T> 214template <class T>
215bool OPimAccessTemplate<T>::remove( const T& t ) { 215bool OPimAccessTemplate<T>::remove( const T& t ) {
216 return remove( t.uid() ); 216 return remove( t.uid() );
217} 217}
218template <class T> 218template <class T>
219bool OPimAccessTemplate<T>::remove( int uid ) { 219bool OPimAccessTemplate<T>::remove( int uid ) {
220 m_cache.remove( uid ); 220 m_cache.remove( uid );
221 return m_backEnd->remove( uid ); 221 return m_backEnd->remove( uid );
222} 222}
223template <class T> 223template <class T>
224bool OPimAccessTemplate<T>::replace( const T& t ) { 224bool OPimAccessTemplate<T>::replace( const T& t ) {
225 m_cache.replace( t ); 225 m_cache.replace( t );
226 return m_backEnd->replace( t ); 226 return m_backEnd->replace( t );
227} 227}
228template <class T> 228template <class T>
229void OPimAccessTemplate<T>::invalidateCache() { 229void OPimAccessTemplate<T>::invalidateCache() {
230 m_cache.invalidate(); 230 m_cache.invalidate();
231} 231}
232template <class T> 232template <class T>
233OPimAccessTemplate<T>::BackEnd* OPimAccessTemplate<T>::backEnd() { 233typename OPimAccessTemplate<T>::BackEnd* OPimAccessTemplate<T>::backEnd() {
234 return m_backEnd; 234 return m_backEnd;
235} 235}
236template <class T> 236template <class T>
237bool OPimAccessTemplate<T>::wasChangedExternally()const { 237bool OPimAccessTemplate<T>::wasChangedExternally()const {
238 return false; 238 return false;
239} 239}
240template <class T> 240template <class T>
241void OPimAccessTemplate<T>::setBackEnd( BackEnd* end ) { 241void OPimAccessTemplate<T>::setBackEnd( BackEnd* end ) {
242 m_backEnd = end; 242 m_backEnd = end;
243 if (m_backEnd ) 243 if (m_backEnd )
244 m_backEnd->setFrontend( this ); 244 m_backEnd->setFrontend( this );
245} 245}
246template <class T> 246template <class T>
247void OPimAccessTemplate<T>::cache( const T& t ) const{ 247void OPimAccessTemplate<T>::cache( const T& t ) const{
248 /* hacky we need to work around the const*/ 248 /* hacky we need to work around the const*/
249 ((OPimAccessTemplate<T>*)this)->m_cache.add( t ); 249 ((OPimAccessTemplate<T>*)this)->m_cache.add( t );
250} 250}
251template <class T> 251template <class T>
252void OPimAccessTemplate<T>::setSaneCacheSize( int size ) { 252void OPimAccessTemplate<T>::setSaneCacheSize( int size ) {
253 m_cache.setSize( size ); 253 m_cache.setSize( size );
254} 254}
255template <class T> 255template <class T>
256void OPimAccessTemplate<T>::setReadAhead( uint count ) { 256void OPimAccessTemplate<T>::setReadAhead( uint count ) {
257 m_backEnd->setReadAhead( count ); 257 m_backEnd->setReadAhead( count );
diff --git a/libopie/pim/orecordlist.h b/libopie/pim/orecordlist.h
index 8ed41e2..b77a4ab 100644
--- a/libopie/pim/orecordlist.h
+++ b/libopie/pim/orecordlist.h
@@ -226,54 +226,54 @@ uint ORecordListIterator<T>::current()const {
226 return m_current; 226 return m_current;
227} 227}
228template <class T> 228template <class T>
229void ORecordListIterator<T>::setCurrent( uint cur ) { 229void ORecordListIterator<T>::setCurrent( uint cur ) {
230 if( cur < m_uids.count() ) { 230 if( cur < m_uids.count() ) {
231 m_end = false; 231 m_end = false;
232 m_current= cur; 232 m_current= cur;
233 } 233 }
234} 234}
235template <class T> 235template <class T>
236uint ORecordListIterator<T>::count()const { 236uint ORecordListIterator<T>::count()const {
237 return m_uids.count(); 237 return m_uids.count();
238} 238}
239template <class T> 239template <class T>
240ORecordList<T>::ORecordList( const QArray<int>& ids, 240ORecordList<T>::ORecordList( const QArray<int>& ids,
241 const Base* acc ) 241 const Base* acc )
242 : m_ids( ids ), m_acc( acc ) 242 : m_ids( ids ), m_acc( acc )
243{ 243{
244} 244}
245template <class T> 245template <class T>
246ORecordList<T>::~ORecordList() { 246ORecordList<T>::~ORecordList() {
247/* nothing to do here */ 247/* nothing to do here */
248} 248}
249template <class T> 249template <class T>
250ORecordList<T>::Iterator ORecordList<T>::begin() { 250typename ORecordList<T>::Iterator ORecordList<T>::begin() {
251 Iterator it( m_ids, m_acc ); 251 Iterator it( m_ids, m_acc );
252 return it; 252 return it;
253} 253}
254template <class T> 254template <class T>
255ORecordList<T>::Iterator ORecordList<T>::end() { 255typename ORecordList<T>::Iterator ORecordList<T>::end() {
256 Iterator it( m_ids, m_acc ); 256 Iterator it( m_ids, m_acc );
257 it.m_end = true; 257 it.m_end = true;
258 it.m_current = m_ids.count(); 258 it.m_current = m_ids.count();
259 259
260 return it; 260 return it;
261} 261}
262template <class T> 262template <class T>
263uint ORecordList<T>::count()const { 263uint ORecordList<T>::count()const {
264return m_ids.count(); 264return m_ids.count();
265} 265}
266template <class T> 266template <class T>
267T ORecordList<T>::operator[]( uint i ) { 267T ORecordList<T>::operator[]( uint i ) {
268 if ( i < 0 || (i+1) > m_ids.count() ) 268 if ( i < 0 || (i+1) > m_ids.count() )
269 return T(); 269 return T();
270 /* forward */ 270 /* forward */
271 return m_acc->find( m_ids[i], m_ids, i ); 271 return m_acc->find( m_ids[i], m_ids, i );
272} 272}
273template <class T> 273template <class T>
274int ORecordList<T>::uidAt( uint i ) { 274int ORecordList<T>::uidAt( uint i ) {
275 return m_ids[i]; 275 return m_ids[i];
276} 276}
277 277
278template <class T> 278template <class T>
279bool ORecordList<T>::remove( int uid ) { 279bool ORecordList<T>::remove( int uid ) {
diff --git a/libopie/pim/otodo.cpp b/libopie/pim/otodo.cpp
index 0d5b1d3..4d5cb79 100644
--- a/libopie/pim/otodo.cpp
+++ b/libopie/pim/otodo.cpp
@@ -378,28 +378,28 @@ void OTodo::changeOrModify() {
378 qWarning("changeOrModify"); 378 qWarning("changeOrModify");
379 data->deref(); 379 data->deref();
380 OTodoData* d2 = new OTodoData(); 380 OTodoData* d2 = new OTodoData();
381 copy(data, d2 ); 381 copy(data, d2 );
382 data = d2; 382 data = d2;
383 } 383 }
384} 384}
385void OTodo::copy( OTodoData* src, OTodoData* dest ) { 385void OTodo::copy( OTodoData* src, OTodoData* dest ) {
386 dest->date = src->date; 386 dest->date = src->date;
387 dest->isCompleted = src->isCompleted; 387 dest->isCompleted = src->isCompleted;
388 dest->hasDate = src->hasDate; 388 dest->hasDate = src->hasDate;
389 dest->priority = src->priority; 389 dest->priority = src->priority;
390 dest->desc = src->desc; 390 dest->desc = src->desc;
391 dest->sum = src->sum; 391 dest->sum = src->sum;
392 dest->extra = src->extra; 392 dest->extra = src->extra;
393 dest->prog = src->prog; 393 dest->prog = src->prog;
394 dest->hasAlarmDateTime = src->hasAlarmDateTime; 394 dest->hasAlarmDateTime = src->hasAlarmDateTime;
395 dest->alarmDateTime = src->alarmDateTime; 395 dest->alarmDateTime = src->alarmDateTime;
396 dest->state = src->state; 396 dest->state = src->state;
397 dest->recur = src->recur; 397 dest->recur = src->recur;
398} 398}
399QString OTodo::type() const { 399QString OTodo::type() const {
400 return QString::fromLatin1("OTodo"); 400 return QString::fromLatin1("OTodo");
401} 401}
402QString OTodo::recordField(int id )const { 402QString OTodo::recordField(int /*id*/ )const {
403 return QString::null; 403 return QString::null;
404} 404}
405 405