summaryrefslogtreecommitdiff
path: root/libopie/ofileselector
authorzecke <zecke>2002-09-15 20:00:57 (UTC)
committer zecke <zecke>2002-09-15 20:00:57 (UTC)
commitf79126f5ba0b1d1520e5fb07716ffe9e2479aedf (patch) (side-by-side diff)
tree6e44ff18246728b0861cc7ce974a0a0fae3c6796 /libopie/ofileselector
parent1c5780f34ec9b4dc004714488b46997fe1a0909b (diff)
downloadopie-f79126f5ba0b1d1520e5fb07716ffe9e2479aedf.zip
opie-f79126f5ba0b1d1520e5fb07716ffe9e2479aedf.tar.gz
opie-f79126f5ba0b1d1520e5fb07716ffe9e2479aedf.tar.bz2
Make it compile but it's not working yet
Diffstat (limited to 'libopie/ofileselector') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/ofileselector/ofiledialog.cpp4
-rw-r--r--libopie/ofileselector/ofilelistview.cpp43
-rw-r--r--libopie/ofileselector/ofileselector.cpp56
-rw-r--r--libopie/ofileselector/ofileselector.h2
-rw-r--r--libopie/ofileselector/ofileview.cpp3
-rw-r--r--libopie/ofileselector/ofileview.h2
6 files changed, 69 insertions, 41 deletions
diff --git a/libopie/ofileselector/ofiledialog.cpp b/libopie/ofileselector/ofiledialog.cpp
index 4783004..430def2 100644
--- a/libopie/ofileselector/ofiledialog.cpp
+++ b/libopie/ofileselector/ofiledialog.cpp
@@ -82,5 +82,5 @@ QString OFileDialog::getOpenFileName(int selector,
QString ret;
OFileDialog dlg( caption.isEmpty() ? tr("Open") : caption,
- wid, OFileSelector::OPEN, selector, startDir, file, mimes);
+ wid, OFileSelector::Open, selector, startDir, file, mimes);
dlg.showMaximized();
if( dlg.exec() )
@@ -98,5 +98,5 @@ QString OFileDialog::getSaveFileName(int selector,
QString ret;
OFileDialog dlg( caption.isEmpty() ? tr("Save") : caption,
- wid, OFileSelector::SAVE, selector, startDir, file, mimes);
+ wid, OFileSelector::Save, selector, startDir, file, mimes);
dlg.showMaximized();
if( dlg.exec() )
diff --git a/libopie/ofileselector/ofilelistview.cpp b/libopie/ofileselector/ofilelistview.cpp
index 0c7d45b..7108a5b 100644
--- a/libopie/ofileselector/ofilelistview.cpp
+++ b/libopie/ofileselector/ofilelistview.cpp
@@ -1,3 +1,6 @@
+#include <qpe/mimetype.h>
+#include <qpe/resource.h>
+
#include "ofileselector.h"
#include "ofileselectoritem.h"
@@ -16,5 +19,5 @@ void OFileListView::clear() {
QListView::clear();
}
-void OFileListView::addFile( const QString& mime,
+void OFileListView::addFile( const QString&,
QFileInfo* info,
bool isSymlink ) {
@@ -34,6 +37,6 @@ void OFileListView::addFile( const QString& mime,
else {
name = info->fileName();
- if( ( selector()->mode() == Open && !info->isReadable() )||
- ( selector()->mode() == Save && !info->isWritable() ) ){
+ if( ( selector()->mode() == OFileSelector::Open && !info->isReadable() ) ||
+ ( selector()->mode() == OFileSelector::Save && !info->isWritable() ) ){
locked = true; pix = Resource::loadPixmap("locked");
@@ -49,6 +52,6 @@ void OFileListView::addFile( const QString& /*mime*/, const QString& /*dir*/,
}
-void OFileListView::addDir( const QString& mime,
- QFileInfo* info, bool isSym ) {
+void OFileListView::addDir( const QString&,
+ QFileInfo* info, bool symlink ) {
bool locked = false;
@@ -56,6 +59,6 @@ void OFileListView::addDir( const QString& mime,
QPixmap pix;
- if( ( selector()->mode() == Open && !info->isReadable() ) ||
- ( selector()->mode() == Save && !info->isWritable() ) ){
+ if( ( selector()->mode() == OFileSelector::Open && !info->isReadable() ) ||
+ ( selector()->mode() == OFileSelector::Save && !info->isWritable() ) ){
locked = true;
@@ -79,15 +82,15 @@ void OFileListView::addDir( const QString& mime,
}
-void OFileListView::addDir( const QString& mime, const QString& dir,
- const QString& file, bool ) {
+void OFileListView::addDir( const QString& /*mime*/, const QString& /*dir*/,
+ const QString& /*file*/, bool ) {
}
-void OFileListView::addSymlink( const QString& mime,
- QFileInfo* info,
- bool isSym ) {
+void OFileListView::addSymlink( const QString& /*mime*/,
+ QFileInfo* /*info*/,
+ bool /*isSym*/ ) {
}
-void OFileListView::addSymlink( const QString& mime, const QString& path,
- const QString& file, bool isSym ) {
+void OFileListView::addSymlink( const QString& /*mime*/, const QString& /*path*/,
+ const QString& /*file*/, bool /*isSym*/ ) {
}
@@ -106,11 +109,15 @@ QString OFileListView::selectedName()const{
}
QStringList OFileListView::selectedNames()const {
-
+ QStringList list;
+ list << selectedName();
+ return list;
}
QString OFileListView::selectedPath()const {
-
+ return QString::null;
}
-QString OFileListView::selectedPaths()const {
-
+QStringList OFileListView::selectedPaths()const {
+ QStringList list;
+ list << selectedPath();
+ return list;
}
int OFileListView::fileCount() {
diff --git a/libopie/ofileselector/ofileselector.cpp b/libopie/ofileselector/ofileselector.cpp
index f655606..16ee3ee 100644
--- a/libopie/ofileselector/ofileselector.cpp
+++ b/libopie/ofileselector/ofileselector.cpp
@@ -247,5 +247,5 @@ bool OFileSelector::cd(const QString &path )
void OFileSelector::setSelector(int mode )
{
-QString text;
+ QString text;
switch( mode ){
case Normal:
@@ -262,5 +262,5 @@ QString text;
}
-void OFileSelector::setPopupFactory(OPopupMenuFactory *popup )
+void OFileSelector::setPopupFactory(OPopupMenuFactory */*popup*/ )
{
/* m_custom = popup;
@@ -275,7 +275,7 @@ QString OFileSelector::selectedName() const
QString name;
if( m_selector == Normal ){
- DocLnk lnk = m_select->selectedDocument();
- name = lnk.file();
- }else if( m_selector == Extended || m_selector == ExtendedAll ){
+ DocLnk lnk = m_select->selectedDocument();
+ name = lnk.file();
+ }else {
if ( m_shLne ) {
name = m_currentDir + "/" +m_edit->text();
@@ -305,7 +305,7 @@ QString OFileSelector::selectedPath()const
if( m_selector == Normal ){
path = QPEApplication::documentDir();
- }else if( m_selector == Extended || m_selector == ExtendedAll ){
- ; //FIXME
- }
+ } /*else if( m_selector == Extended || m_selector == ExtendedAll ){
+ ;
+ }*/
return path;
}
@@ -334,5 +334,5 @@ int OFileSelector::fileCount()
case ExtendedAll:
default:
- count = currentView()->childCount();
+ count = currentView()->fileCount();
break;
}
@@ -350,5 +350,5 @@ DocLnk OFileSelector::selectedDocument() const
case ExtendedAll:
default:
- lnk = DocLnk( selectedName() ); // new DocLnk
+ lnk = DocLnk( selectedName() );
break;
}
@@ -373,4 +373,5 @@ void OFileSelector::slotCancel()
emit cancel();
}
+/* switch the views */
void OFileSelector::slotViewCheck(const QString &sel)
{
@@ -405,5 +406,5 @@ void OFileSelector::slotViewCheck(const QString &sel)
}
}
-// not yet finished.....
+
QString OFileSelector::currentMimeType() const{
QString mime;
@@ -632,5 +633,5 @@ void OFileSelector::initVars()
m_close = 0;
}
-void OFileSelector::addFile(const QString &mime, QFileInfo *info, bool symlink)
+void OFileSelector::addFile(const QString &, QFileInfo *info, bool )
{
if(!m_files)
@@ -643,5 +644,5 @@ void OFileSelector::addFile(const QString &mime, QFileInfo *info, bool symlink)
}
-void OFileSelector::addDir(const QString &mime, QFileInfo *info, bool symlink )
+void OFileSelector::addDir(const QString &, QFileInfo *, bool )
{
if(!m_dir)
@@ -926,5 +927,4 @@ bool OFileSelector::compliesMime( const QString& mime ) {
QStringList::Iterator it2;
int pos;
- int pos2;
for ( it2 = list.begin(); it2 != list.end(); ++it2 ) {
pos = (*it2).findRev("/*");
@@ -950,6 +950,7 @@ void OFileSelector::slotSelectionChanged()
}
-void OFileSelector::slotCurrentChanged(QListViewItem* item )
+void OFileSelector::slotCurrentChanged(QListViewItem* /*item*/ )
{
+ /*
if( item == 0 )
return;
@@ -969,8 +970,10 @@ void OFileSelector::slotCurrentChanged(QListViewItem* item )
}
}
- }
+ } */
}
-void OFileSelector::slotClicked( int button, QListViewItem *item, const QPoint &, int)
+void OFileSelector::slotClicked( int /*button*/, QListViewItem */*item*/, const QPoint &, int)
+
{
+ /*
if ( item == 0 )
return;
@@ -982,5 +985,5 @@ void OFileSelector::slotClicked( int button, QListViewItem *item, const QPoint &
default:
break;
- case Extended: // fall through
+ case Extended: // fall through
case ExtendedAll:{
OFileSelectorItem *sel = (OFileSelectorItem*)item;
@@ -1002,5 +1005,5 @@ void OFileSelector::slotClicked( int button, QListViewItem *item, const QPoint &
break;
}
- }
+ } */
}
void OFileSelector::slotRightButton(int button, QListViewItem *item, const QPoint &, int )
@@ -1013,5 +1016,5 @@ void OFileSelector::slotRightButton(int button, QListViewItem *item, const QPoin
slotContextMenu( item );
}
-void OFileSelector::slotContextMenu( QListViewItem *item)
+void OFileSelector::slotContextMenu( QListViewItem */*item*/)
{
@@ -1019,4 +1022,5 @@ void OFileSelector::slotContextMenu( QListViewItem *item)
void OFileSelector::slotChangedDir()
{
+ /*
OFileSelectorItem *sel = (OFileSelectorItem*)m_View->currentItem();
if(sel->isDir() ){
@@ -1024,7 +1028,9 @@ void OFileSelector::slotChangedDir()
cd( sel->directory() + "/" + str[0].stripWhiteSpace() );
}
+ */
}
void OFileSelector::slotOpen()
{
+ /*
OFileSelectorItem *sel = (OFileSelectorItem*)m_View->currentItem();
if(!sel->isDir() ){
@@ -1035,4 +1041,5 @@ void OFileSelector::slotOpen()
//emit fileSelected( lnk );
}
+ */
}
void OFileSelector::slotRescan()
@@ -1046,4 +1053,5 @@ void OFileSelector::slotRename()
void OFileSelector::slotDelete()
{
+ /*
OFileSelectorItem *sel = (OFileSelectorItem*)m_View->currentItem();
QStringList list = QStringList::split("->", sel->text(1) );
@@ -1061,4 +1069,5 @@ void OFileSelector::slotDelete()
m_View->takeItem( sel );
delete sel;
+ */
}
void OFileSelector::cdUP()
@@ -1211,4 +1220,7 @@ OFileView* OFileSelector::currentView() {
return 0l;
}
+OFileView* OFileSelector::currentView() const{
+ return 0l;
+}
int OFileSelector::filter() {
int filter;
@@ -1245,2 +1257,6 @@ void OFileSelector::internChangedDir( const QDir& s) {
emit dirSelected( s );
}
+QPixmap OFileSelector::pixmap( const QString& s ) {
+
+ return (*m_pixmaps)[s];
+}
diff --git a/libopie/ofileselector/ofileselector.h b/libopie/ofileselector/ofileselector.h
index 937569d..12af732 100644
--- a/libopie/ofileselector/ofileselector.h
+++ b/libopie/ofileselector/ofileselector.h
@@ -337,6 +337,8 @@ class OFileSelector : public QWidget {
OFileView* currentView();
+ OFileView* currentView()const;
int filter();
int sorting();
+ QPixmap pixmap( const QString& );
signals:
diff --git a/libopie/ofileselector/ofileview.cpp b/libopie/ofileselector/ofileview.cpp
index 71843c1..9bb40c9 100644
--- a/libopie/ofileselector/ofileview.cpp
+++ b/libopie/ofileselector/ofileview.cpp
@@ -27,2 +27,5 @@ void OFileView::changedDir( const QDir& d ) {
m_sel->internChangedDir( d );
}
+OFileSelector* OFileView::selector() const {
+ return m_sel;
+}
diff --git a/libopie/ofileselector/ofileview.h b/libopie/ofileselector/ofileview.h
index 997266a..1b397f5 100644
--- a/libopie/ofileselector/ofileview.h
+++ b/libopie/ofileselector/ofileview.h
@@ -91,5 +91,5 @@ protected:
void changedDir(const QString &);
void changedDir(const QDir & );
- OFileSelector* selector();
+ OFileSelector* selector()const;
private: