summaryrefslogtreecommitdiff
authorkergoth <kergoth>2002-03-18 23:19:42 (UTC)
committer kergoth <kergoth>2002-03-18 23:19:42 (UTC)
commitf56d7e8481779ee3f1b307effbb7a0601de4ba7a (patch) (unidiff)
tree7e52279966f597d3dcf7c7c5124f64887570dfbf
parent35d040816fd59e247efbe9727ecd810bcba7c2b9 (diff)
downloadopie-f56d7e8481779ee3f1b307effbb7a0601de4ba7a.zip
opie-f56d7e8481779ee3f1b307effbb7a0601de4ba7a.tar.gz
opie-f56d7e8481779ee3f1b307effbb7a0601de4ba7a.tar.bz2
Fixing package conflicts.
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/apps/textedit/fileSaver.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/apps/textedit/fileSaver.cpp b/core/apps/textedit/fileSaver.cpp
index fbf50cf..07fb5ba 100644
--- a/core/apps/textedit/fileSaver.cpp
+++ b/core/apps/textedit/fileSaver.cpp
@@ -1,180 +1,180 @@
1/**************************************************************************** 1/****************************************************************************
2** copyright 2001 ljp ljp@llornkcor.com 2** copyright 2001 ljp ljp@llornkcor.com
3** Created: Fri Dec 14 08:16:46 2001 fileSaver.cpp 3** Created: Fri Dec 14 08:16:46 2001 fileSaver.cpp
4** 4**
5** This file may be distributed and/or modified under the terms of the 5** This file may be distributed and/or modified under the terms of the
6** GNU General Public License version 2 as published by the Free Software 6** GNU General Public License version 2 as published by the Free Software
7** Foundation and appearing in the file LICENSE.GPL included in the 7** Foundation and appearing in the file LICENSE.GPL included in the
8** packaging of this file. 8** packaging of this file.
9** 9**
10** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 10** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
11** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 11** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
12** 12**
13****************************************************************************/ 13****************************************************************************/
14#include "fileSaver.h" 14#include "fileSaver.h"
15#include <qpe/config.h> 15#include <qpe/config.h>
16#include <qpe/resource.h> 16#include <qpe/resource.h>
17 17
18#include <qpe/qpeapplication.h> 18#include <qpe/qpeapplication.h>
19#include <qlistview.h> 19#include <qlistview.h>
20#include <qpushbutton.h> 20#include <qpushbutton.h>
21#include <qfile.h> 21#include <qfile.h>
22#include <qmessagebox.h> 22#include <qmessagebox.h>
23#include <qlineedit.h> 23#include <qlineedit.h>
24#include <qcheckbox.h> 24#include <qcheckbox.h>
25 25
26#include <unistd.h> 26#include <unistd.h>
27 27
28fileSaver::fileSaver( QWidget* parent, const char* name, bool modal, WFlags fl , const QString currentFileName ) 28fileSaver::fileSaver( QWidget* parent, const char* name, bool modal, WFlags fl , const QString currentFileName )
29 : QDialog( parent, name, modal, fl ) 29 : QDialog( parent, name, modal, fl )
30{ 30{
31 if ( !name ) 31 if ( !name )
32 setName( "fileSaver" ); 32 setName( "fileSaver" );
33 resize( 240, 280 ); 33 resize( 240, 280 );
34 setCaption(tr( name ) ); 34 setCaption(tr( name ) );
35 QFileInfo fi(currentFileName); 35 QFileInfo fi(currentFileName);
36 QString tmpFileName=fi.fileName(); 36 QString tmpFileName=fi.fileName();
37// qDebug( tmpFileName); 37// qDebug( tmpFileName);
38 dirLabel = new QLabel(this, "DirLabel"); 38 dirLabel = new QLabel(this, "DirLabel");
39 dirLabel->setText(currentDir.canonicalPath()); 39 dirLabel->setText(currentDir.canonicalPath());
40 dirLabel->setGeometry(10,20,230,15); 40 dirLabel->setGeometry(10,20,230,15);
41 41
42 homeButton = new QPushButton(Resource::loadIconSet("home"),"",this,"homeButton"); 42 homeButton = new QPushButton(Resource::loadIconSet("home"),"",this,"homeButton");
43 homeButton->setGeometry(200,4,25,25); 43 homeButton->setGeometry(200,4,25,25);
44 connect(homeButton,SIGNAL(released()),this,SLOT(homeButtonPushed()) ); 44 connect(homeButton,SIGNAL(released()),this,SLOT(homeButtonPushed()) );
45 homeButton->setFlat(TRUE); 45 homeButton->setFlat(TRUE);
46 46
47 docButton = new QPushButton(Resource::loadIconSet("DocsIcon"),"",this,"docsButton"); 47 docButton = new QPushButton(Resource::loadIconSet("DocsIcon"),"",this,"docsButton");
48 docButton->setGeometry(170,4,25,25); 48 docButton->setGeometry(170,4,25,25);
49 connect( docButton,SIGNAL(released()),this,SLOT( docButtonPushed()) ); 49 connect( docButton,SIGNAL(released()),this,SLOT( docButtonPushed()) );
50 docButton->setFlat(TRUE); 50 docButton->setFlat(TRUE);
51 51
52 hideButton = new QPushButton( Resource::loadIconSet("s_hidden"),"",this,"hideButton"); 52 hideButton = new QPushButton( Resource::loadIconSet("textedit/s_hidden"),"",this,"hideButton");
53 hideButton->setGeometry(140,4,25,25); 53 hideButton->setGeometry(140,4,25,25);
54 connect( hideButton,SIGNAL(toggled(bool)),this,SLOT( hideButtonPushed(bool)) ); 54 connect( hideButton,SIGNAL(toggled(bool)),this,SLOT( hideButtonPushed(bool)) );
55 hideButton->setToggleButton(TRUE); 55 hideButton->setToggleButton(TRUE);
56 hideButton->setFlat(TRUE); 56 hideButton->setFlat(TRUE);
57 57
58 ListView = new QListView( this, "ListView" ); 58 ListView = new QListView( this, "ListView" );
59 ListView->addColumn( tr( "Name" ) ); 59 ListView->addColumn( tr( "Name" ) );
60 ListView->setColumnWidth(0,140); 60 ListView->setColumnWidth(0,140);
61 ListView->setSorting( 2, FALSE); 61 ListView->setSorting( 2, FALSE);
62 ListView->addColumn( tr( "Size" ) ); 62 ListView->addColumn( tr( "Size" ) );
63 ListView->setColumnWidth(1,59); 63 ListView->setColumnWidth(1,59);
64 ListView->setColumnWidthMode(0,QListView::Manual); 64 ListView->setColumnWidthMode(0,QListView::Manual);
65 ListView->setColumnAlignment(1,QListView::AlignRight); 65 ListView->setColumnAlignment(1,QListView::AlignRight);
66// ListView->setMultiSelection(true); 66// ListView->setMultiSelection(true);
67// ListView->setSelectionMode(QListView::Extended); 67// ListView->setSelectionMode(QListView::Extended);
68 68
69 ListView->setAllColumnsShowFocus( TRUE ); 69 ListView->setAllColumnsShowFocus( TRUE );
70 ListView->setGeometry( QRect( 10,35,220,125)); 70 ListView->setGeometry( QRect( 10,35,220,125));
71 71
72 fileEdit= new QLineEdit(this); 72 fileEdit= new QLineEdit(this);
73 fileEdit->setGeometry( QRect( 10, 162, 205, 17)); 73 fileEdit->setGeometry( QRect( 10, 162, 205, 17));
74 74
75 fileEdit->setText( tmpFileName); 75 fileEdit->setText( tmpFileName);
76 76
77 filePermCheck = new QCheckBox( this, "SetFilePerms" ); 77 filePermCheck = new QCheckBox( this, "SetFilePerms" );
78 filePermCheck->setText("set file permissions"); 78 filePermCheck->setText("set file permissions");
79 filePermCheck->setGeometry(10, 178, 150,17); 79 filePermCheck->setGeometry(10, 178, 150,17);
80 // signals and slots connections 80 // signals and slots connections
81 connect( ListView, SIGNAL(doubleClicked( QListViewItem*)), SLOT(listDoubleClicked(QListViewItem *)) ); 81 connect( ListView, SIGNAL(doubleClicked( QListViewItem*)), SLOT(listDoubleClicked(QListViewItem *)) );
82 connect( ListView, SIGNAL(pressed( QListViewItem*)), SLOT(listClicked(QListViewItem *)) ); 82 connect( ListView, SIGNAL(pressed( QListViewItem*)), SLOT(listClicked(QListViewItem *)) );
83 83
84// tmpFileName=fi.FilePath(); 84// tmpFileName=fi.FilePath();
85// qDebug( tmpFileName); 85// qDebug( tmpFileName);
86 currentDir.setPath( QDir::currentDirPath() ); 86 currentDir.setPath( QDir::currentDirPath() );
87 currentDir.setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden */| QDir::All); 87 currentDir.setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden */| QDir::All);
88 populateList(); 88 populateList();
89 move(0,15); 89 move(0,15);
90 fileEdit->setFocus(); 90 fileEdit->setFocus();
91} 91}
92 92
93fileSaver::~fileSaver() 93fileSaver::~fileSaver()
94{ 94{
95} 95}
96 96
97void fileSaver::populateList() 97void fileSaver::populateList()
98{ 98{
99 ListView->clear(); 99 ListView->clear();
100 currentDir.setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst); 100 currentDir.setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst);
101 currentDir.setMatchAllDirs(TRUE); 101 currentDir.setMatchAllDirs(TRUE);
102 102
103 currentDir.setNameFilter("*"); 103 currentDir.setNameFilter("*");
104 QString fileL, fileS; 104 QString fileL, fileS;
105 const QFileInfoList *list = currentDir.entryInfoList( /*QDir::All*/ /*, QDir::SortByMask*/); 105 const QFileInfoList *list = currentDir.entryInfoList( /*QDir::All*/ /*, QDir::SortByMask*/);
106 QFileInfoListIterator it(*list); 106 QFileInfoListIterator it(*list);
107 QFileInfo *fi; 107 QFileInfo *fi;
108 while ( (fi=it.current()) ) { 108 while ( (fi=it.current()) ) {
109 109
110 if (fi->isSymLink() ){ 110 if (fi->isSymLink() ){
111 QString symLink=fi->readLink(); 111 QString symLink=fi->readLink();
112// qDebug("Symlink detected "+symLink); 112// qDebug("Symlink detected "+symLink);
113 QFileInfo sym( symLink); 113 QFileInfo sym( symLink);
114 fileS.sprintf( "%10li", sym.size() ); 114 fileS.sprintf( "%10li", sym.size() );
115 fileL.sprintf( "%s -> %s", sym.fileName().data(),sym.absFilePath().data() ); 115 fileL.sprintf( "%s -> %s", sym.fileName().data(),sym.absFilePath().data() );
116 116
117 } else { 117 } else {
118// // qDebug("Not a dir: "+currentDir.canonicalPath()+fileL); 118// // qDebug("Not a dir: "+currentDir.canonicalPath()+fileL);
119 fileS.sprintf( "%10li", fi->size() ); 119 fileS.sprintf( "%10li", fi->size() );
120 fileL.sprintf( "%s",fi->fileName().data() ); 120 fileL.sprintf( "%s",fi->fileName().data() );
121 if( QDir(QDir::cleanDirPath(currentDir.canonicalPath()+"/"+fileL)).exists() ) { 121 if( QDir(QDir::cleanDirPath(currentDir.canonicalPath()+"/"+fileL)).exists() ) {
122 fileL+="/"; 122 fileL+="/";
123// qDebug(currentDir.canonicalPath()+fileL); 123// qDebug(currentDir.canonicalPath()+fileL);
124 } 124 }
125 } 125 }
126 item= new QListViewItem( ListView,fileL,fileS ); 126 item= new QListViewItem( ListView,fileL,fileS );
127 ++it; 127 ++it;
128 } 128 }
129 ListView->setSorting( 2, FALSE); 129 ListView->setSorting( 2, FALSE);
130 dirLabel->setText(currentDir.canonicalPath()); 130 dirLabel->setText(currentDir.canonicalPath());
131 131
132 132
133} 133}
134 134
135void fileSaver::upDir() 135void fileSaver::upDir()
136{ 136{
137// qDebug(currentDir.canonicalPath()); 137// qDebug(currentDir.canonicalPath());
138} 138}
139 139
140void fileSaver::listDoubleClicked(QListViewItem *selectedItem) 140void fileSaver::listDoubleClicked(QListViewItem *selectedItem)
141{ 141{
142} 142}
143 143
144void fileSaver::listClicked(QListViewItem *selectedItem) 144void fileSaver::listClicked(QListViewItem *selectedItem)
145{ 145{
146 QString strItem=selectedItem->text(0); 146 QString strItem=selectedItem->text(0);
147 QString strSize=selectedItem->text(1); 147 QString strSize=selectedItem->text(1);
148// qDebug("strItem is "+strItem); 148// qDebug("strItem is "+strItem);
149 strSize.stripWhiteSpace(); 149 strSize.stripWhiteSpace();
150// qDebug(strSize); 150// qDebug(strSize);
151 151
152 if(strItem.find("@",0,TRUE) !=-1 || strItem.find("->",0,TRUE) !=-1 ) { //if symlink 152 if(strItem.find("@",0,TRUE) !=-1 || strItem.find("->",0,TRUE) !=-1 ) { //if symlink
153 QString strItem2=strItem.right( (strItem.length()-strItem.find("->",0,TRUE)) -4); 153 QString strItem2=strItem.right( (strItem.length()-strItem.find("->",0,TRUE)) -4);
154// qDebug("strItem symlink is "+strItem2); 154// qDebug("strItem symlink is "+strItem2);
155 if(QDir(strItem2).exists() ) { 155 if(QDir(strItem2).exists() ) {
156 currentDir.cd(strItem2, TRUE); 156 currentDir.cd(strItem2, TRUE);
157 populateList(); 157 populateList();
158 } 158 }
159 } else { // not a symlink 159 } else { // not a symlink
160 if(strItem.find(". .",0,TRUE) && strItem.find("/",0,TRUE)!=-1 ) { 160 if(strItem.find(". .",0,TRUE) && strItem.find("/",0,TRUE)!=-1 ) {
161 if(QDir(QDir::cleanDirPath(currentDir.canonicalPath()+"/"+strItem)).exists() ) { 161 if(QDir(QDir::cleanDirPath(currentDir.canonicalPath()+"/"+strItem)).exists() ) {
162 strItem=QDir::cleanDirPath(currentDir.canonicalPath()+"/"+strItem); 162 strItem=QDir::cleanDirPath(currentDir.canonicalPath()+"/"+strItem);
163 currentDir.cd(strItem,FALSE); 163 currentDir.cd(strItem,FALSE);
164// qDebug("Path is "+strItem); 164// qDebug("Path is "+strItem);
165 populateList(); 165 populateList();
166 } else { 166 } else {
167 currentDir.cdUp(); 167 currentDir.cdUp();
168 populateList(); 168 populateList();
169 } 169 }
170 if(QDir(strItem).exists()){ 170 if(QDir(strItem).exists()){
171 currentDir.cd(strItem, TRUE); 171 currentDir.cd(strItem, TRUE);
172 populateList(); 172 populateList();
173 } 173 }
174 } // else 174 } // else
175// if( QFile::exists(strItem ) ) { 175// if( QFile::exists(strItem ) ) {
176// qDebug("We found our files!!"); 176// qDebug("We found our files!!");
177 177
178// OnOK(); 178// OnOK();
179 } //end not symlink 179 } //end not symlink
180 chdir(strItem.latin1()); 180 chdir(strItem.latin1());