author | zecke <zecke> | 2002-11-03 11:03:20 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-11-03 11:03:20 (UTC) |
commit | 207f7430db6c90e88825ea2bedc9ae1bf68e3d99 (patch) (side-by-side diff) | |
tree | fb69b58f130c0b0a17224989f26aa4af5939b33e /libopie | |
parent | 485fae36510cb42690c9df55fae64312b1e656ae (diff) | |
download | opie-207f7430db6c90e88825ea2bedc9ae1bf68e3d99.zip opie-207f7430db6c90e88825ea2bedc9ae1bf68e3d99.tar.gz opie-207f7430db6c90e88825ea2bedc9ae1bf68e3d99.tar.bz2 |
Patch by Simon Hausmann to suit gcc3 needs
many thanks
-rw-r--r-- | libopie/oclickablelabel.cpp | 2 | ||||
-rw-r--r-- | libopie/ofileselector.cc | 9 | ||||
-rw-r--r-- | libopie/ofileselector.h | 2 | ||||
-rw-r--r-- | libopie/ofileselector/odefaultfactories.cpp | 4 | ||||
-rw-r--r-- | libopie/ofileselector/odefaultfactories.h | 1 | ||||
-rw-r--r-- | libopie/ofileselector/ofileselector.cpp | 3 | ||||
-rw-r--r-- | libopie/pim/opimaccessbackend.h | 4 | ||||
-rw-r--r-- | libopie/pim/opimaccesstemplate.h | 10 | ||||
-rw-r--r-- | libopie/pim/orecordlist.h | 4 | ||||
-rw-r--r-- | libopie/pim/otodo.cpp | 2 |
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 @@ #include "oclickablelabel.h" #include <stdio.h> OClickableLabel::OClickableLabel(QWidget* parent, const char* name, WFlags fl) : QLabel(parent,name,fl) { textInverted=false; isToggle=false; isDown=false; showState(false); setFrameShadow(Sunken); } void OClickableLabel::setToggleButton(bool t) { isToggle=t; } -void OClickableLabel::mousePressEvent( QMouseEvent *e ) { +void OClickableLabel::mousePressEvent( QMouseEvent * /*e*/ ) { if (isToggle && isDown) { showState(false); } else { showState(true); } } void OClickableLabel::mouseReleaseEvent( QMouseEvent *e ) { if (rect().contains(e->pos()) && isToggle) isDown=!isDown; if (isToggle && isDown) { showState(true); } else { showState(false); } if (rect().contains(e->pos())) { if (isToggle) { emit toggled(isDown); } emit clicked(); } } 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 QString OFileSelector::selectedPath()const { QString path; if( m_selector == NORMAL ){ path = QPEApplication::documentDir(); }else if( m_selector == EXTENDED || m_selector == EXTENDED_ALL ){ ; } return path; } QStringList OFileSelector::selectedPaths() const { QStringList list; list << selectedPath(); return list; } QString OFileSelector::directory()const { if( m_selector == NORMAL ) return QPEApplication::documentDir(); return QDir(m_currentDir).absPath(); } -int OFileSelector::fileCount() +int OFileSelector::fileCount() const { int count; switch( m_selector ){ case NORMAL: count = m_select->fileCount(); break; //case CUSTOM: case EXTENDED: case EXTENDED_ALL: default: count = m_View->childCount(); break; } return count; } DocLnk OFileSelector::selectedDocument() const { DocLnk lnk; switch( m_selector ){ case NORMAL:{ lnk = m_select->selectedDocument(); break; } case EXTENDED: @@ -661,81 +661,81 @@ void OFileSelector::initVars() m_docButton = 0; m_hideButton = 0; m_ok = 0; m_cancel = 0; m_reread = 0; m_up = 0; m_View = 0; m_checkPerm = 0; m_pseudo = 0; m_pseudoLayout = 0; m_select = 0; m_stack = 0; m_lay = 0; m_Oselector = 0; m_boxToolbar = 0; m_boxOk = 0; m_boxName = 0; m_boxView = 0; m_custom = 0; m_edit = 0; m_fnLabel = 0; m_new = 0; m_close = 0; } -void OFileSelector::addFile(const QString &mime, QFileInfo *info, bool symlink) +void OFileSelector::addFile(const QString &/*mime*/, QFileInfo *info, bool symlink) { if(!m_files) return; // if( !compliesMime(info->absFilePath(), mime ) ) // return; MimeType type( info->absFilePath() ); if (!compliesMime( type.id() ) ) return; QPixmap pix = type.pixmap(); QString dir; QString name; bool locked; if( pix.isNull() ) pix = Resource::loadPixmap( "UnknownDocument-14"); dir = info->dirPath( true ); if( symlink ) name = info->fileName() + " -> " +info->dirPath() + "/" + info->readLink(); else { name = info->fileName(); if( ( m_mode == OPEN && !info->isReadable() )|| ( m_mode == SAVE && !info->isWritable() ) ){ locked = true; pix = Resource::loadPixmap("locked"); } } new OFileSelectorItem( m_View, pix, name, info->lastModified().toString(), QString::number( info->size() ), dir, locked ); } -void OFileSelector::addDir(const QString &mime, QFileInfo *info, bool symlink ) +void OFileSelector::addDir(const QString &/*mime*/, QFileInfo *info, bool symlink ) { if(!m_dir) return; if( m_selector == EXTENDED_ALL || m_selector == EXTENDED ){ bool locked = false; QString name; QPixmap pix; if( ( m_mode == OPEN && !info->isReadable() ) || ( m_mode == SAVE && !info->isWritable() ) ){ locked = true; if( symlink ) pix = (*m_pixmaps)["symlinkedlocked"]; else pix = Resource::loadPixmap("lockedfolder"); }else { // readable pix = symlink ? (*m_pixmaps)["dirsymlink"] : Resource::loadPixmap("folder") ; } name = symlink ? info->fileName() + "->" + info->dirPath(true) + "/" +info->readLink() : info->fileName() ; new OFileSelectorItem( m_View, pix, name, info->lastModified().toString(), QString::number( info->size() ), info->dirPath( true ), locked, true ); }// else CUSTOM View @@ -997,49 +997,48 @@ bool OFileSelector::compliesMime( const QString& mime ) { qWarning("current text is %s", currentText.latin1() ); QMap<QString, QStringList>::Iterator it; QStringList list; if ( currentText == tr("All") ) return true; else if ( currentText.isEmpty() && !m_mimetypes.isEmpty() ) { it = m_mimetypes.begin(); list = it.data(); }else if ( currentText.isEmpty() ) return true; else{ it = m_mimetypes.find(currentText ); if ( it == m_mimetypes.end() ) qWarning("not there"), list << currentText; else qWarning("found"), list = it.data(); } // dump it now //for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) { // qWarning( "%s", (*it).latin1() ); //} if ( list.contains(mime) ) return true; qWarning("list doesn't contain it "); QStringList::Iterator it2; int pos; - int pos2; for ( it2 = list.begin(); it2 != list.end(); ++it2 ) { pos = (*it2).findRev("/*"); if ( pos >= 0 ) { if ( mime.contains( (*it2).left(pos) ) ) return true; } } return false; } void OFileSelector::slotFileSelected( const QString &string ) { if( m_shLne ) m_edit->setText( string ); emit fileSelected( string ); } void OFileSelector::slotFileBridgeSelected( const DocLnk &lnk ) { slotFileSelected( lnk.name() ); emit fileSelected( lnk ); } void OFileSelector::slotSelectionChanged() { } void OFileSelector::slotCurrentChanged(QListViewItem* item ) @@ -1084,49 +1083,49 @@ void OFileSelector::slotClicked( int button, QListViewItem *item, const QPoint & // if MODE Dir m_shLne set the Text }else{ if( m_shLne ) m_edit->setText( str[0].stripWhiteSpace() ); qWarning("selected here in slot clicked"); emit fileSelected( sel->directory() + "/" + str[0].stripWhiteSpace() ); DocLnk lnk( sel->directory() + "/" + str[0].stripWhiteSpace() ); qWarning("file selected"); emit fileSelected( lnk ); } } break; } } } void OFileSelector::slotRightButton(int button, QListViewItem *item, const QPoint &, int ) { if( item == 0 ) return; if( button != Qt::RightButton ) return; slotContextMenu( item ); } -void OFileSelector::slotContextMenu( QListViewItem *item) +void OFileSelector::slotContextMenu( QListViewItem * /*item*/) { } void OFileSelector::slotChangedDir() { OFileSelectorItem *sel = (OFileSelectorItem*)m_View->currentItem(); if(sel->isDir() ){ QStringList str = QStringList::split("->", sel->text(1) ); cd( sel->directory() + "/" + str[0].stripWhiteSpace() ); } } void OFileSelector::slotOpen() { OFileSelectorItem *sel = (OFileSelectorItem*)m_View->currentItem(); if(!sel->isDir() ){ QStringList str = QStringList::split("->", sel->text(1) ); slotFileSelected( sel->directory() +"/" +str[0].stripWhiteSpace() ); qWarning("slot open"); // DocLnk lnk( sel->directory() + "/" + str[0].stripWhiteSpace() ); //emit fileSelected( lnk ); } } void OFileSelector::slotRescan() { 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 { bool showFiles()const { return m_files; }; void setShowFiles(bool ); bool cd(const QString &path ); int mode()const { return m_mode; }; int selector()const { return m_selector; }; void setSelector( int ); bool showPopup()const { return m_showPopup; }; void setShowPopup( bool pop ) { m_showPopup = pop; }; void setPopupMenu( QPopupMenu * ); // void updateLay(); void reparse(); // re reads the dir QString selectedName( )const; QStringList selectedNames()const; QString selectedPath() const; QStringList selectedPaths() const; QString directory()const; - int fileCount(); + int fileCount() const; /* the user needs to delete it */ DocLnk selectedDocument()const; /* the user needs to delete it */ QValueList<DocLnk> selectedDocuments()const; signals: void fileSelected( const DocLnk & ); void fileSelected( const QString & ); void dirSelected(const QString &dir ); void closeMe(); void ok(); void cancel(); void contextMenu(); private slots: void slotTest() { qWarning("slotTest" ); setLineEditVisible(false ); }; void slotOk(); void slotCancel(); void slotViewCheck(const QString & ); void slotMimeCheck(const QString & ); void slotLocationActivated(const QString & ); void slotInsertLocationPath(const QString &, int); 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 @@ #include "ofilelistview.h" -#include "ofileiconview.h" #include "olocallister.h" #include "odefaultfactories.h" extern "C" { - OFileView* newFileIconView( OFileSelector* sel, QWidget* parent ) { - return new OFileIconView( parent, sel ); - } OFileView* newFileListView( OFileSelector* sel, QWidget* par ) { return new OFileListView(par, sel ); } OLister* newLocalLister( OFileSelector* sel) { return new OLocalLister( sel ); } }; 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 @@ #ifndef OPIE_DEFAULT_FACTORIES_H #define OPIE_DEFAULT_FACTORIES_H #include "ofilefactory.h" extern "C" { - OFileView* newFileIconView( OFileSelector*, QWidget* parent ); OFileView* newFileListView( OFileSelector*, QWidget* parent ); OLister* newLocalLister(OFileSelector* ); }; #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 ) { delete m_select; m_lister =0l; m_fileView = 0l; m_select = 0l; if ( lis.startsWith("All") ) { m_selector = ExtendedAll; list = lis.mid(4 ).stripWhiteSpace(); } else{ list = lis; m_selector = Extended; } setLister(m_listerName); m_fileView = factory()->view( list, this, m_mainView ); m_mainView->setWidget( m_fileView->widget() ); reparse(); } } /* * the factory */ void OFileSelector::initFactory() { m_fileFactory = new OFileFactory(); m_fileFactory->addLister(tr("Files"), newLocalLister ); m_fileFactory->addView(tr("List View"), newFileListView ); - m_fileFactory->addView(tr("Documents"), newFileIconView ); + /* dummy entry */ + m_fileFactory->addView(tr("Documents"), newFileListView ); } void OFileSelector::fillList() { qWarning("fill list"); if (!m_viewCheck ) return; m_viewCheck->clear(); QStringList list = factory()->views(); qWarning("views: " + list.join(";") ); for (QStringList::Iterator it = list.begin(); it != list.end(); ++it ) { qWarning( (*it) ); if ( (*it) == tr("Documents") ) { m_viewCheck->insertItem( (*it) ); }else{ m_viewCheck->insertItem( (*it) ); m_viewCheck->insertItem( tr("All ") + (*it) ); } } } OFileFactory* OFileSelector::factory() { return m_fileFactory; } 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: * save the resource and * all it's changes */ virtual bool save() = 0; /** * return an array of * all available uids */ virtual QArray<int> allRecords()const = 0; /** * queryByExample for T with the SortOrder * sort */ virtual QArray<int> queryByExample( const T& t, int sort ) = 0; /** * find the OPimRecord with uid @param uid * returns T and T.isEmpty() if nothing was found */ virtual T find(int uid )const = 0; virtual T find(int uid, const QArray<int>& items, - uint current, Frontend::CacheDirection )const ; + uint current, typename Frontend::CacheDirection )const ; /** * clear the back end */ virtual void clear() = 0; /** * add T */ virtual bool add( const T& t ) = 0; /** * remove */ virtual bool remove( int uid ) = 0; /** * replace a record with T.uid() */ virtual bool replace( const T& t ) = 0; /* * setTheFrontEnd!!! */ void setFrontend( Frontend* front ); @@ -106,36 +106,36 @@ private: template <class T> OPimAccessBackend<T>::OPimAccessBackend() { m_front = 0l; } template <class T> OPimAccessBackend<T>::~OPimAccessBackend() { } template <class T> void OPimAccessBackend<T>::setFrontend( Frontend* fr ) { m_front = fr; } template <class T> void OPimAccessBackend<T>::cache( const T& t )const { if (m_front ) m_front->cache( t ); } template <class T> void OPimAccessBackend<T>::setSaneCacheSize( int size) { if (m_front ) m_front->setSaneCacheSize( size ); } template <class T> T OPimAccessBackend<T>::find( int uid, const QArray<int>&, - uint, Frontend::CacheDirection )const { + uint, typename Frontend::CacheDirection )const { return find( uid ); } template <class T> void OPimAccessBackend<T>::setReadAhead( uint count ) { m_read = count; } template <class T> uint OPimAccessBackend<T>::readAhead()const { return m_read; } #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: */ bool wasChangedExternally()const; /** * return a List of records * you can iterate over them */ virtual List allRecords()const; /** * queryByExample. * @see otodoaccess, ocontactaccess */ virtual List queryByExample( const T& t, int querySettings ); /** * find the OPimRecord uid */ virtual T find( int uid )const; /** * read ahead cache find method ;) */ virtual T find( int uid, const QArray<int>&, - uint current, CacheDirection dir = Forward )const; + uint current, typename OTemplateBase<T>::CacheDirection dir = OTemplateBase<T>::Forward )const; /* invalidate cache here */ /** * clears the backend and invalidates the backend */ virtual void clear() ; /** * add T to the backend * @param t The item to add. * @return <i>true</i> if added successfully. */ virtual bool add( const T& t ) ; /* only the uid matters */ /** * remove T from the backend * @param t The item to remove * @return <i>true</i> if successful. */ virtual bool remove( const T& t ); /** * remove the OPimRecord with uid @@ -144,114 +144,114 @@ OPimAccessTemplate<T>::OPimAccessTemplate( BackEnd* end ) { if (end ) end->setFrontend( this ); } template <class T> OPimAccessTemplate<T>::~OPimAccessTemplate() { qWarning("~OPimAccessTemplate<T>"); delete m_backEnd; } template <class T> bool OPimAccessTemplate<T>::load() { invalidateCache(); return m_backEnd->load(); } template <class T> bool OPimAccessTemplate<T>::reload() { invalidateCache(); // zecke: I think this should be added (se) return m_backEnd->reload(); } template <class T> bool OPimAccessTemplate<T>::save() { return m_backEnd->save(); } template <class T> -OPimAccessTemplate<T>::List OPimAccessTemplate<T>::allRecords()const { +typename OPimAccessTemplate<T>::List OPimAccessTemplate<T>::allRecords()const { QArray<int> ints = m_backEnd->allRecords(); List lis(ints, this ); return lis; } template <class T> -OPimAccessTemplate<T>::List +typename OPimAccessTemplate<T>::List OPimAccessTemplate<T>::queryByExample( const T& t, int sortOrder ) { QArray<int> ints = m_backEnd->queryByExample( t, sortOrder ); List lis(ints, this ); return lis; } template <class T> T OPimAccessTemplate<T>::find( int uid ) const{ T t = m_backEnd->find( uid ); cache( t ); return t; } template <class T> T OPimAccessTemplate<T>::find( int uid, const QArray<int>& ar, - uint current, CacheDirection dir )const { + uint current, typename OTemplateBase<T>::CacheDirection dir )const { /* * better do T.isEmpty() * after a find this way we would * avoid two finds in QCache... */ // qWarning("find it now %d", uid ); if (m_cache.contains( uid ) ) { return m_cache.find( uid ); } T t = m_backEnd->find( uid, ar, current, dir ); cache( t ); return t; } template <class T> void OPimAccessTemplate<T>::clear() { invalidateCache(); m_backEnd->clear(); } template <class T> bool OPimAccessTemplate<T>::add( const T& t ) { cache( t ); return m_backEnd->add( t ); } template <class T> bool OPimAccessTemplate<T>::remove( const T& t ) { return remove( t.uid() ); } template <class T> bool OPimAccessTemplate<T>::remove( int uid ) { m_cache.remove( uid ); return m_backEnd->remove( uid ); } template <class T> bool OPimAccessTemplate<T>::replace( const T& t ) { m_cache.replace( t ); return m_backEnd->replace( t ); } template <class T> void OPimAccessTemplate<T>::invalidateCache() { m_cache.invalidate(); } template <class T> -OPimAccessTemplate<T>::BackEnd* OPimAccessTemplate<T>::backEnd() { +typename OPimAccessTemplate<T>::BackEnd* OPimAccessTemplate<T>::backEnd() { return m_backEnd; } template <class T> bool OPimAccessTemplate<T>::wasChangedExternally()const { return false; } template <class T> void OPimAccessTemplate<T>::setBackEnd( BackEnd* end ) { m_backEnd = end; if (m_backEnd ) m_backEnd->setFrontend( this ); } template <class T> void OPimAccessTemplate<T>::cache( const T& t ) const{ /* hacky we need to work around the const*/ ((OPimAccessTemplate<T>*)this)->m_cache.add( t ); } template <class T> void OPimAccessTemplate<T>::setSaneCacheSize( int size ) { m_cache.setSize( size ); } template <class T> void OPimAccessTemplate<T>::setReadAhead( uint count ) { 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 { return m_current; } template <class T> void ORecordListIterator<T>::setCurrent( uint cur ) { if( cur < m_uids.count() ) { m_end = false; m_current= cur; } } template <class T> uint ORecordListIterator<T>::count()const { return m_uids.count(); } template <class T> ORecordList<T>::ORecordList( const QArray<int>& ids, const Base* acc ) : m_ids( ids ), m_acc( acc ) { } template <class T> ORecordList<T>::~ORecordList() { /* nothing to do here */ } template <class T> -ORecordList<T>::Iterator ORecordList<T>::begin() { +typename ORecordList<T>::Iterator ORecordList<T>::begin() { Iterator it( m_ids, m_acc ); return it; } template <class T> -ORecordList<T>::Iterator ORecordList<T>::end() { +typename ORecordList<T>::Iterator ORecordList<T>::end() { Iterator it( m_ids, m_acc ); it.m_end = true; it.m_current = m_ids.count(); return it; } template <class T> uint ORecordList<T>::count()const { return m_ids.count(); } template <class T> T ORecordList<T>::operator[]( uint i ) { if ( i < 0 || (i+1) > m_ids.count() ) return T(); /* forward */ return m_acc->find( m_ids[i], m_ids, i ); } template <class T> int ORecordList<T>::uidAt( uint i ) { return m_ids[i]; } template <class T> bool 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() { qWarning("changeOrModify"); data->deref(); OTodoData* d2 = new OTodoData(); copy(data, d2 ); data = d2; } } void OTodo::copy( OTodoData* src, OTodoData* dest ) { dest->date = src->date; dest->isCompleted = src->isCompleted; dest->hasDate = src->hasDate; dest->priority = src->priority; dest->desc = src->desc; dest->sum = src->sum; dest->extra = src->extra; dest->prog = src->prog; dest->hasAlarmDateTime = src->hasAlarmDateTime; dest->alarmDateTime = src->alarmDateTime; dest->state = src->state; dest->recur = src->recur; } QString OTodo::type() const { return QString::fromLatin1("OTodo"); } -QString OTodo::recordField(int id )const { +QString OTodo::recordField(int /*id*/ )const { return QString::null; } |