summaryrefslogtreecommitdiffabout
path: root/microkde
authorzautrix <zautrix>2005-06-18 16:38:24 (UTC)
committer zautrix <zautrix>2005-06-18 16:38:24 (UTC)
commit1919ddd25fb835b0eb03a44cbfbf4713d45266b8 (patch) (unidiff)
treef2ed65d2ad6b204dcb7eeb76da8776aae69aba6c /microkde
parent4ad2d49928757d72657735e088ac1cf587637fca (diff)
downloadkdepimpi-1919ddd25fb835b0eb03a44cbfbf4713d45266b8.zip
kdepimpi-1919ddd25fb835b0eb03a44cbfbf4713d45266b8.tar.gz
kdepimpi-1919ddd25fb835b0eb03a44cbfbf4713d45266b8.tar.bz2
fixed links
Diffstat (limited to 'microkde') (more/less context) (ignore whitespace changes)
-rw-r--r--microkde/ofileselector_p.cpp34
1 files changed, 27 insertions, 7 deletions
diff --git a/microkde/ofileselector_p.cpp b/microkde/ofileselector_p.cpp
index f85f8f4..e2af32b 100644
--- a/microkde/ofileselector_p.cpp
+++ b/microkde/ofileselector_p.cpp
@@ -111,131 +111,149 @@ QString ODocumentFileView::directory()const {
111void ODocumentFileView::reread() { 111void ODocumentFileView::reread() {
112 if (!m_selector) 112 if (!m_selector)
113 return; 113 return;
114 114
115 m_selector->setNewVisible( showNew() ); 115 m_selector->setNewVisible( showNew() );
116 m_selector->setCloseVisible( showClose() ); 116 m_selector->setCloseVisible( showClose() );
117 m_selector->filter = currentMimeType().join(";"); 117 m_selector->filter = currentMimeType().join(";");
118 m_selector->reread(); 118 m_selector->reread();
119} 119}
120int ODocumentFileView::fileCount()const { 120int ODocumentFileView::fileCount()const {
121 if (!m_selector) 121 if (!m_selector)
122 return -1; 122 return -1;
123 123
124 return m_selector->fileCount(); 124 return m_selector->fileCount();
125} 125}
126 126
127DocLnk ODocumentFileView::selectedDocument()const { 127DocLnk ODocumentFileView::selectedDocument()const {
128 if (!m_selector) 128 if (!m_selector)
129 return DocLnk(); 129 return DocLnk();
130 DocLnk lnk = *m_selector->selected(); 130 DocLnk lnk = *m_selector->selected();
131 return lnk; 131 return lnk;
132} 132}
133 133
134QWidget* ODocumentFileView::widget( QWidget* parent ) { 134QWidget* ODocumentFileView::widget( QWidget* parent ) {
135 if (!m_selector ) { 135 if (!m_selector ) {
136 m_selector = new FileSelector(currentMimeType().join(";"), parent, "fileselector", showNew(), showClose() ); 136 m_selector = new FileSelector(currentMimeType().join(";"), parent, "fileselector", showNew(), showClose() );
137 QObject::connect(m_selector, SIGNAL(fileSelected( const DocLnk& ) ), 137 QObject::connect(m_selector, SIGNAL(fileSelected( const DocLnk& ) ),
138 selector(), SLOT(slotDocLnkBridge(const DocLnk&) ) ); 138 selector(), SLOT(slotDocLnkBridge(const DocLnk&) ) );
139 QObject::connect(m_selector, SIGNAL(closeMe() ), 139 QObject::connect(m_selector, SIGNAL(closeMe() ),
140 selector(), SIGNAL(closeMe() ) ); 140 selector(), SIGNAL(closeMe() ) );
141 QObject::connect(m_selector, SIGNAL(newSelected(const DocLnk& ) ), 141 QObject::connect(m_selector, SIGNAL(newSelected(const DocLnk& ) ),
142 selector(), SIGNAL(newSelected(const DocLnk& ) ) ); 142 selector(), SIGNAL(newSelected(const DocLnk& ) ) );
143 } 143 }
144 144
145 return m_selector; 145 return m_selector;
146} 146}
147 147
148/* 148/*
149 * This is the file system view used 149 * This is the file system view used
150 * we use a QListView + QListViewItems for it 150 * we use a QListView + QListViewItems for it
151 */ 151 */
152 152
153OFileSelectorItem::OFileSelectorItem( QListView* view, const QPixmap& pixmap, 153OFileSelectorItem::OFileSelectorItem( QListView* view, const QPixmap& pixmap,
154 const QString& path, const QString& date, 154 const QString& path, const QString& date,
155 const QString& size, const QString& dir, 155 const QString& size, const QString& dir,
156 bool isLocked, bool isDir ) 156 bool isLocked, bool isDir )
157 : QListViewItem( view ) 157 : QListViewItem( view )
158{ 158{
159
160 QString kind;
161 QString _path = path;
162 if ( isDir )
163 kind = "dir";
164 else
165 kind = "file";
159 setPixmap(0, pixmap ); 166 setPixmap(0, pixmap );
160 setText(1, path ); 167 int arrow = path.find( "->" );
168 if (arrow > 0 ) {
169 kind += path.mid( arrow );
170 _path = path.left(arrow);
171 }
172 setText(1, _path );
161 setText(2, size ); 173 setText(2, size );
162 setText(3, date ); 174 setText(3, date );
175 setText(4, kind );
163 m_isDir = isDir; 176 m_isDir = isDir;
164 m_dir = dir; 177 m_dir = dir;
165 m_locked = isLocked; 178 m_locked = isLocked;
166} 179}
167OFileSelectorItem::~OFileSelectorItem() { 180OFileSelectorItem::~OFileSelectorItem() {
168 181
169} 182}
170bool OFileSelectorItem::isLocked()const { 183bool OFileSelectorItem::isLocked()const {
171 return m_locked; 184 return m_locked;
172} 185}
173QString OFileSelectorItem::directory()const { 186QString OFileSelectorItem::directory()const {
174 return m_dir; 187 return m_dir;
175} 188}
176bool OFileSelectorItem::isDir()const { 189bool OFileSelectorItem::isDir()const {
177 return m_isDir; 190 return m_isDir;
178} 191}
179QString OFileSelectorItem::path()const { 192QString OFileSelectorItem::path()const {
180 return text( 1 ); 193 return text( 1 );
181} 194}
182QString OFileSelectorItem::key( int id, bool )const { 195QString OFileSelectorItem::key( int id, bool )const {
183 QString ke; 196 QString ke;
184 if( id == 0 || id == 1 ){ // name 197 if( id == 0 || id == 1 ){ // name
185 if( m_isDir ){ 198 if( m_isDir ){
186 ke.append("0" ); 199 ke.append("0" );
187 ke.append( text(1) ); 200 ke.append( text(1) );
188 }else{ 201 }else{
189 ke.append("1" ); 202 ke.append("1" );
190 ke.append( text(1) ); 203 ke.append( text(1) );
191 } 204 }
192 return ke; 205 return ke;
193 }else 206 } else if ( id == 2 ) {
207 QString sort = "00000000";
208 sort = sort.left( 9-text( 2 ).length()) + text( 2 );
209 return sort;
210
211 } else
194 return text( id ); 212 return text( id );
195 213
196} 214}
197 215
198OFileViewFileListView::OFileViewFileListView( QWidget* parent, const QString& startDir, 216OFileViewFileListView::OFileViewFileListView( QWidget* parent, const QString& startDir,
199 OFileSelector* sel) 217 OFileSelector* sel)
200 : QWidget( parent ), m_sel( sel ) { 218 : QWidget( parent ), m_sel( sel ) {
201 m_all = false; 219 m_all = false;
202 QVBoxLayout* lay = new QVBoxLayout( this ); 220 QVBoxLayout* lay = new QVBoxLayout( this );
203 m_currentDir = startDir; 221 m_currentDir = startDir;
204 222
205 /* 223 /*
206 * now we add a special bar 224 * now we add a special bar
207 * One Button For Up 225 * One Button For Up
208 * Home 226 * Home
209 * Doc 227 * Doc
210 * And a dropdown menu with FileSystems 228 * And a dropdown menu with FileSystems
211 * FUTURE: one to change dir with lineedit 229 * FUTURE: one to change dir with lineedit
212 * Bookmarks 230 * Bookmarks
213 * Create Dir 231 * Create Dir
214 */ 232 */
215 QHBox* box = new QHBox(this ); 233 QHBox* box = new QHBox(this );
216 box->setBackgroundMode( PaletteButton ); 234 box->setBackgroundMode( PaletteButton );
217 box->setSpacing( 0 ); 235 box->setSpacing( 0 );
218 236
219 QToolButton *btn = new QToolButton( box ); 237 QToolButton *btn = new QToolButton( box );
220 btn->setIconSet( Resource::loadPixmap("up") ); 238 btn->setIconSet( Resource::loadPixmap("up") );
221 connect(btn, SIGNAL(clicked() ), 239 connect(btn, SIGNAL(clicked() ),
222 this, SLOT( cdUP() ) ); 240 this, SLOT( cdUP() ) );
223 241
224 btn = new QToolButton( box ); 242 btn = new QToolButton( box );
225 btn->setIconSet( Resource::loadPixmap("home") ); 243 btn->setIconSet( Resource::loadPixmap("home") );
226 connect(btn, SIGNAL(clicked() ), 244 connect(btn, SIGNAL(clicked() ),
227 this, SLOT( cdHome() ) ); 245 this, SLOT( cdHome() ) );
228 246
229 btn = new QToolButton( box ); 247 btn = new QToolButton( box );
230 btn->setIconSet( Resource::loadPixmap("DocsIcon") ); 248 btn->setIconSet( Resource::loadPixmap("DocsIcon") );
231 connect(btn, SIGNAL(clicked() ), 249 connect(btn, SIGNAL(clicked() ),
232 this, SLOT(cdDoc() ) ); 250 this, SLOT(cdDoc() ) );
233 251
234 m_btnNew = new QToolButton( box ); 252 m_btnNew = new QToolButton( box );
235 m_btnNew->setIconSet( Resource::loadPixmap("new") ); 253 m_btnNew->setIconSet( Resource::loadPixmap("new") );
236 connect(m_btnNew, SIGNAL(clicked() ), 254 connect(m_btnNew, SIGNAL(clicked() ),
237 this, SLOT(slotNew() ) ); 255 this, SLOT(slotNew() ) );
238 256
239 257
240 m_btnClose = new QToolButton( box ); 258 m_btnClose = new QToolButton( box );
241 m_btnClose->setIconSet( Resource::loadPixmap("close") ); 259 m_btnClose->setIconSet( Resource::loadPixmap("close") );
@@ -300,110 +318,112 @@ OFileSelectorItem* OFileViewFileListView::currentItem()const{
300} 318}
301void OFileViewFileListView::reread( bool all ) { 319void OFileViewFileListView::reread( bool all ) {
302 m_view->clear(); 320 m_view->clear();
303 321
304 if (selector()->showClose() ) 322 if (selector()->showClose() )
305 m_btnClose->show(); 323 m_btnClose->show();
306 else 324 else
307 m_btnClose->hide(); 325 m_btnClose->hide();
308 326
309 if (selector()->showNew() ) 327 if (selector()->showNew() )
310 m_btnNew->show(); 328 m_btnNew->show();
311 else 329 else
312 m_btnNew->hide(); 330 m_btnNew->hide();
313 331
314 m_mimes = selector()->currentMimeType(); 332 m_mimes = selector()->currentMimeType();
315 m_all = all; 333 m_all = all;
316 334
317 QDir dir( m_currentDir ); 335 QDir dir( m_currentDir );
318 if (!dir.exists() ) 336 if (!dir.exists() )
319 return; 337 return;
320 topLevelWidget()->setCaption( dir.path() ); 338 topLevelWidget()->setCaption( dir.path() );
321 dir.setSorting( QDir::Name | QDir::DirsFirst | QDir::Reversed ); 339 dir.setSorting( QDir::Name | QDir::DirsFirst | QDir::Reversed );
322 int filter; 340 int filter;
323 if (m_all ) 341 if (m_all )
324 filter = QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All; 342 filter = QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All;
325 else 343 else
326 filter = QDir::Files | QDir::Dirs | QDir::All; 344 filter = QDir::Files | QDir::Dirs | QDir::All;
327 dir.setFilter( filter ); 345 dir.setFilter( filter );
328 346
329 // now go through all files 347 // now go through all files
330 const QFileInfoList *list = dir.entryInfoList(); 348 const QFileInfoList *list = dir.entryInfoList();
331 if (!list) { 349 if (!list) {
332 cdUP(); 350 cdUP();
333 return; 351 return;
334 } 352 }
335 QFileInfoListIterator it( *list ); 353 QFileInfoListIterator it( *list );
336 QFileInfo *fi; 354 QFileInfo *fi;
337 while( (fi=it.current() ) ){ 355 while( (fi=it.current() ) ){
338 if( fi->fileName() == QString::fromLatin1("..") || fi->fileName() == QString::fromLatin1(".") ){ 356 if( fi->fileName() == QString::fromLatin1("..") || fi->fileName() == QString::fromLatin1(".") ){
339 ++it; 357 ++it;
340 continue; 358 continue;
341 } 359 }
342 360
343 /* 361 /*
344 * It is a symlink we try to resolve it now but don't let us attack by DOS 362 * It is a symlink we try to resolve it now but don't let us attack by DOS
345 * 363 *
346 */ 364 */
347 if( fi->isSymLink() ){ 365 if( fi->isSymLink() ){
348 QString file = fi->dirPath( true ) + "/" + fi->readLink(); 366 qDebug("SYMLINK ");
349 for( int i = 0; i<=4; i++) { // 5 tries to prevent dos 367 QString file = fi->readLink();
368 for( int i = 0; i<=5; i++) { // 5 tries to prevent dos
350 QFileInfo info( file ); 369 QFileInfo info( file );
370 qDebug("FILE %s ", file.latin1());
351 if( !info.exists() ){ 371 if( !info.exists() ){
352 addSymlink( fi, TRUE ); 372 addSymlink( fi, TRUE );
353 break; 373 break;
354 }else if( info.isDir() ){ 374 }else if( info.isDir() ){
355 addDir( fi, TRUE ); 375 addDir( fi, TRUE );
356 break; 376 break;
357 }else if( info.isFile() ){ 377 }else if( info.isFile() ){
358 addFile( fi, TRUE ); 378 addFile( fi, TRUE );
359 break; 379 break;
360 }else if( info.isSymLink() ){ 380 }else if( info.isSymLink() ){
361 file = info.dirPath(true ) + "/" + info.readLink() ; 381 file = info.readLink() ;
362 break; 382 break;
363 }else if( i == 4){ // couldn't resolve symlink add it as symlink 383 }else if( i == 4){ // couldn't resolve symlink add it as symlink
364 addSymlink( fi ); 384 addSymlink( fi );
365 } 385 }
366 } // off for loop for symlink resolving 386 } // off for loop for symlink resolving
367 }else if( fi->isDir() ) 387 }else if( fi->isDir() )
368 addDir( fi ); 388 addDir( fi );
369 else if( fi->isFile() ) 389 else if( fi->isFile() )
370 addFile( fi ); 390 addFile( fi );
371 391
372 ++it; 392 ++it;
373 } // of while loop 393 } // of while loop
374 m_view->sort(); 394 m_view->sort();
375 395
376} 396}
377int OFileViewFileListView::fileCount()const{ 397int OFileViewFileListView::fileCount()const{
378 return m_view->childCount(); 398 return m_view->childCount();
379} 399}
380QString OFileViewFileListView::currentDir()const{ 400QString OFileViewFileListView::currentDir()const{
381 return m_currentDir; 401 return m_currentDir;
382} 402}
383OFileSelector* OFileViewFileListView::selector() { 403OFileSelector* OFileViewFileListView::selector() {
384 return m_sel; 404 return m_sel;
385} 405}
386 406
387bool OFileViewFileListView::eventFilter (QObject *o, QEvent *e) { 407bool OFileViewFileListView::eventFilter (QObject *o, QEvent *e) {
388#if 0 408#if 0
389 if ( e->type() == QEvent::KeyPress ) { 409 if ( e->type() == QEvent::KeyPress ) {
390 QKeyEvent *k = (QKeyEvent *)e; 410 QKeyEvent *k = (QKeyEvent *)e;
391 if ( (k->key()==Key_Enter) || (k->key()==Key_Return)) { 411 if ( (k->key()==Key_Enter) || (k->key()==Key_Return)) {
392 slotClicked( Qt::LeftButton,m_view->currentItem(),QPoint(0,0),0); 412 slotClicked( Qt::LeftButton,m_view->currentItem(),QPoint(0,0),0);
393 return true; 413 return true;
394 } 414 }
395 } 415 }
396#endif 416#endif
397 return false; 417 return false;
398} 418}
399 419
400 420
401void OFileViewFileListView::connectSlots() { 421void OFileViewFileListView::connectSlots() {
402 connect(m_view, SIGNAL(clicked(QListViewItem*) ), 422 connect(m_view, SIGNAL(clicked(QListViewItem*) ),
403 this, SLOT(slotCurrentChanged(QListViewItem*) ) ); 423 this, SLOT(slotCurrentChanged(QListViewItem*) ) );
404 connect(m_view, SIGNAL(mouseButtonClicked(int, QListViewItem*, const QPoint&, int ) ), 424 connect(m_view, SIGNAL(mouseButtonClicked(int, QListViewItem*, const QPoint&, int ) ),
405 this, SLOT(slotClicked(int, QListViewItem*, const QPoint&, int ) ) ); 425 this, SLOT(slotClicked(int, QListViewItem*, const QPoint&, int ) ) );
406 connect(m_view, SIGNAL(doubleClicked( QListViewItem* )), 426 connect(m_view, SIGNAL(doubleClicked( QListViewItem* )),
407 this, SLOT(slotDoubleClicked(QListViewItem* ) ) ); 427 this, SLOT(slotDoubleClicked(QListViewItem* ) ) );
408 connect(m_view, SIGNAL(returnPressed( QListViewItem* )), 428 connect(m_view, SIGNAL(returnPressed( QListViewItem* )),
409 this, SLOT(slotDoubleClicked(QListViewItem* ) ) ); 429 this, SLOT(slotDoubleClicked(QListViewItem* ) ) );
@@ -441,123 +461,123 @@ void OFileViewFileListView::slotDoubleClicked(QListViewItem* item ) {
441 }else { // file 461 }else { // file
442 //qWarning("slot Clicked"); 462 //qWarning("slot Clicked");
443 selector()->m_lneEdit->setText( str[0].stripWhiteSpace() ); 463 selector()->m_lneEdit->setText( str[0].stripWhiteSpace() );
444 QString path = sel->directory() + "/" + str[0].stripWhiteSpace(); 464 QString path = sel->directory() + "/" + str[0].stripWhiteSpace();
445 emit selector()->fileSelected( path ); 465 emit selector()->fileSelected( path );
446 DocLnk lnk( path ); 466 DocLnk lnk( path );
447 emit selector()->fileSelected( lnk ); 467 emit selector()->fileSelected( lnk );
448 emit selector()->ok(); 468 emit selector()->ok();
449 } 469 }
450 } // not locked 470 } // not locked
451} 471}
452void OFileViewFileListView::slotClicked(int button , QListViewItem* item, const QPoint&, int ) { 472void OFileViewFileListView::slotClicked(int button , QListViewItem* item, const QPoint&, int ) {
453 if (!item || ( button != Qt::LeftButton) ) 473 if (!item || ( button != Qt::LeftButton) )
454 return; 474 return;
455 475
456 OFileSelectorItem *sel = static_cast<OFileSelectorItem*>(item); 476 OFileSelectorItem *sel = static_cast<OFileSelectorItem*>(item);
457 if (!sel->isLocked() ) { 477 if (!sel->isLocked() ) {
458 QStringList str = QStringList::split("->", sel->text(1) ); 478 QStringList str = QStringList::split("->", sel->text(1) );
459 if (sel->isDir() ) { 479 if (sel->isDir() ) {
460 m_currentDir = sel->directory() + "/" + str[0].stripWhiteSpace(); 480 m_currentDir = sel->directory() + "/" + str[0].stripWhiteSpace();
461 emit selector()->dirSelected( m_currentDir ); 481 emit selector()->dirSelected( m_currentDir );
462 reread( m_all ); 482 reread( m_all );
463 }else { // file 483 }else { // file
464 //qWarning("slot Clicked"); 484 //qWarning("slot Clicked");
465 selector()->m_lneEdit->setText( str[0].stripWhiteSpace() ); 485 selector()->m_lneEdit->setText( str[0].stripWhiteSpace() );
466 QString path = sel->directory() + "/" + str[0].stripWhiteSpace(); 486 QString path = sel->directory() + "/" + str[0].stripWhiteSpace();
467 emit selector()->fileSelected( path ); 487 emit selector()->fileSelected( path );
468 DocLnk lnk( path ); 488 DocLnk lnk( path );
469 emit selector()->fileSelected( lnk ); 489 emit selector()->fileSelected( lnk );
470 } 490 }
471 } // not locked 491 } // not locked
472} 492}
473void OFileViewFileListView::addFile( QFileInfo* info, bool symlink ) { 493void OFileViewFileListView::addFile( QFileInfo* info, bool symlink ) {
474 MimeType type( info->absFilePath() ); 494 MimeType type( info->absFilePath() );
475 if (!compliesMime( type.id() ) ) 495 if (!compliesMime( type.id() ) )
476 return; 496 return;
477 497
478 QPixmap pix = type.pixmap(); 498 QPixmap pix = type.pixmap();
479 QString dir, name; bool locked; 499 QString dir, name; bool locked;
480 if ( pix.isNull() ) { 500 if ( pix.isNull() ) {
481 QWMatrix matrix; 501 QWMatrix matrix;
482 QPixmap pixer(Resource::loadPixmap("UnknownDocument") ); 502 QPixmap pixer(Resource::loadPixmap("UnknownDocument") );
483 matrix.scale( .4, .4 ); 503 matrix.scale( .4, .4 );
484 pix = pixer.xForm( matrix ); 504 pix = pixer.xForm( matrix );
485 } 505 }
486 dir = info->dirPath( true ); 506 dir = info->dirPath( true );
487 locked = false; 507 locked = false;
488 if ( symlink ) 508 if ( symlink )
489 name = info->fileName() + " -> " + info->dirPath() + "/" + info->readLink(); 509 name = info->fileName() + " -> " + info->readLink();
490 else{ 510 else{
491 name = info->fileName(); 511 name = info->fileName();
492 if ( ( (selector()->mode() == OFileSelector::Open)&& !info->isReadable() ) || 512 if ( ( (selector()->mode() == OFileSelector::Open)&& !info->isReadable() ) ||
493 ( (selector()->mode() == OFileSelector::Save)&& !info->isWritable() ) ) { 513 ( (selector()->mode() == OFileSelector::Save)&& !info->isWritable() ) ) {
494 locked = true; pix = Resource::loadPixmap("locked"); 514 locked = true; pix = Resource::loadPixmap("locked");
495 } 515 }
496 } 516 }
497 (void)new OFileSelectorItem( m_view, pix, name, 517 (void)new OFileSelectorItem( m_view, pix, name,
498 KGlobal::locale()->formatDateTime(info->lastModified(),true, true, KLocale::ISODate), 518 KGlobal::locale()->formatDateTime(info->lastModified(),true, true, KLocale::ISODate),
499 QString::number( info->size() ), 519 QString::number( info->size() ),
500 dir, locked ); 520 dir, locked );
501} 521}
502void OFileViewFileListView::addDir( QFileInfo* info, bool symlink ) { 522void OFileViewFileListView::addDir( QFileInfo* info, bool symlink ) {
503 bool locked = false; QString name; QPixmap pix; 523 bool locked = false; QString name; QPixmap pix;
504 524
505 if ( ( ( selector()->mode() == OFileSelector::Open ) && !info->isReadable() ) || 525 if ( ( ( selector()->mode() == OFileSelector::Open ) && !info->isReadable() ) ||
506 ( ( selector()->mode() == OFileSelector::Save ) && !info->isWritable() ) ) { 526 ( ( selector()->mode() == OFileSelector::Save ) && !info->isWritable() ) ) {
507 locked = true; 527 locked = true;
508 if ( symlink ) 528 if ( symlink )
509 pix = Resource::loadPixmap( "symlink" ); 529 pix = Resource::loadPixmap( "symlink" );
510 else 530 else
511 pix = Resource::loadPixmap( "lockedfolder" ); 531 pix = Resource::loadPixmap( "lockedfolder" );
512 }else 532 }else
513 pix = symlink ? Resource::loadPixmap( "symlink") : Resource::loadPixmap("folder"); 533 pix = symlink ? Resource::loadPixmap( "symlink") : Resource::loadPixmap("folder");
514 534
515 name = symlink ? info->fileName() + " -> " + info->dirPath(true) + "/" + info->readLink() : 535 name = symlink ? info->fileName() + " -> " + info->readLink() :
516 info->fileName(); 536 info->fileName();
517 537
518 (void)new OFileSelectorItem( m_view, pix, name, 538 (void)new OFileSelectorItem( m_view, pix, name,
519 KGlobal::locale()->formatDateTime(info->lastModified(),true, true, KLocale::ISODate), 539 KGlobal::locale()->formatDateTime(info->lastModified(),true, true, KLocale::ISODate),
520 QString::number( info->size() ), 540 QString::number( info->size() ),
521 info->dirPath( true ), locked, true ); 541 info->dirPath( true ), locked, true );
522 542
523 543
524} 544}
525void OFileViewFileListView::addSymlink( QFileInfo* , bool ) { 545void OFileViewFileListView::addSymlink( QFileInfo* , bool ) {
526 546
527} 547}
528void OFileViewFileListView::cdUP() { 548void OFileViewFileListView::cdUP() {
529 QDir dir( m_currentDir ); 549 QDir dir( m_currentDir );
530 dir.cdUp(); 550 dir.cdUp();
531 551
532 if (!dir.exists() ) 552 if (!dir.exists() )
533 m_currentDir = "/"; 553 m_currentDir = "/";
534 else 554 else
535 m_currentDir = dir.absPath(); 555 m_currentDir = dir.absPath();
536 556
537 emit selector()->dirSelected( m_currentDir ); 557 emit selector()->dirSelected( m_currentDir );
538 reread( m_all ); 558 reread( m_all );
539} 559}
540void OFileViewFileListView::cdHome() { 560void OFileViewFileListView::cdHome() {
541 m_currentDir = QDir::homeDirPath(); 561 m_currentDir = QDir::homeDirPath();
542 emit selector()->dirSelected( m_currentDir ); 562 emit selector()->dirSelected( m_currentDir );
543 reread( m_all ); 563 reread( m_all );
544} 564}
545void OFileViewFileListView::cdDoc() { 565void OFileViewFileListView::cdDoc() {
546 m_currentDir = QPEApplication::documentDir(); 566 m_currentDir = QPEApplication::documentDir();
547 emit selector()->dirSelected( m_currentDir ); 567 emit selector()->dirSelected( m_currentDir );
548 reread( m_all ); 568 reread( m_all );
549} 569}
550void OFileViewFileListView::changeDir( const QString& dir ) { 570void OFileViewFileListView::changeDir( const QString& dir ) {
551 m_currentDir = dir; 571 m_currentDir = dir;
552 emit selector()->dirSelected( m_currentDir ); 572 emit selector()->dirSelected( m_currentDir );
553 reread( m_all ); 573 reread( m_all );
554} 574}
555void OFileViewFileListView::slotFSActivated( int id ) { 575void OFileViewFileListView::slotFSActivated( int id ) {
556 changeDir ( m_dev[m_fsPop->text(id)] ); 576 changeDir ( m_dev[m_fsPop->text(id)] );
557} 577}
558 578
559/* check if the mimetype in mime 579/* check if the mimetype in mime
560 * complies with the one which is current 580 * complies with the one which is current
561 */ 581 */
562/* 582/*
563 * We've the mimetype of the file 583 * We've the mimetype of the file