summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2003-03-16 21:13:17 (UTC)
committer llornkcor <llornkcor>2003-03-16 21:13:17 (UTC)
commita637dff6d55b28cba58b8116b457c5bf46daab57 (patch) (unidiff)
tree8698751b7d4c4817f83844898a697d5921d35ae5
parent75ebe1838923e121cb093310f7f7c1b021abdcc1 (diff)
downloadopie-a637dff6d55b28cba58b8116b457c5bf46daab57.zip
opie-a637dff6d55b28cba58b8116b457c5bf46daab57.tar.gz
opie-a637dff6d55b28cba58b8116b457c5bf46daab57.tar.bz2
fix open .desktop file
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--core/apps/textedit/textedit.cpp23
1 files changed, 15 insertions, 8 deletions
diff --git a/core/apps/textedit/textedit.cpp b/core/apps/textedit/textedit.cpp
index 5edf102..59a605a 100644
--- a/core/apps/textedit/textedit.cpp
+++ b/core/apps/textedit/textedit.cpp
@@ -383,7 +383,6 @@ TextEdit::TextEdit( QWidget *parent, const char *name, WFlags f )
383 383
384 defaultFont = QFont ( family, size, weight, italic ); 384 defaultFont = QFont ( family, size, weight, italic );
385 editor-> setFont ( defaultFont ); 385 editor-> setFont ( defaultFont );
386
387// updateCaption(); 386// updateCaption();
388 387
389 cfg.setGroup ( "View" ); 388 cfg.setGroup ( "View" );
@@ -699,27 +698,36 @@ void TextEdit::openFile( const QString &f ) {
699 QString filer; 698 QString filer;
700 QFileInfo fi( f); 699 QFileInfo fi( f);
701// bFromDocView = true; 700// bFromDocView = true;
702 if(f.find(".desktop",0,true) != -1 && !openDesktop ) { 701 if(f.find(".desktop",0,true) != -1 && !openDesktop )
702 {
703 switch ( QMessageBox::warning(this,tr("Text Editor"), 703 switch ( QMessageBox::warning(this,tr("Text Editor"),
704 tr("Text Editor has detected<BR>you selected a <B>.desktop</B> 704 tr("Text Editor has detected<BR>you selected a <B>.desktop</B>
705file.<BR>Open <B>.desktop</B> file or <B>linked</B> file?"), 705file.<BR>Open <B>.desktop</B> file or <B>linked</B> file?"),
706 tr(".desktop File"),tr("Linked Document"),0,1,1) ) { 706 tr(".desktop File"),tr("Linked Document"),0,1,1) )
707 case 0: 707 {
708 case 0: //desktop
708 filer = f; 709 filer = f;
709 break; 710 break;
710 case 1: 711 case 1: //linked
711 DocLnk sf(f); 712 DocLnk sf(f);
712 filer = sf.file(); 713 filer = sf.file();
713 break; 714 break;
715 };
714 } 716 }
715 } else if(fi.baseName().left(1) == "") { 717 else if(fi.baseName().left(1) == "")
718 {
719 qDebug("opening dotfile");
716 currentFileName=f; 720 currentFileName=f;
717 openDotFile(currentFileName); 721 openDotFile(currentFileName);
718 } else { 722 return;
723 }
724 else
725 {
719 DocLnk sf(f); 726 DocLnk sf(f);
720 filer = sf.file(); 727 filer = sf.file();
721 if(filer.right(1) == "/") 728 if(filer.right(1) == "/")
722 filer = f; 729 filer = f;
730 }
723 731
724 DocLnk nf; 732 DocLnk nf;
725 nf.setType("text/plain"); 733 nf.setType("text/plain");
@@ -731,7 +739,6 @@ file.<BR>Open <B>.desktop</B> file or <B>linked</B> file?"),
731 739
732 qDebug("openFile string "+currentFileName); 740 qDebug("openFile string "+currentFileName);
733 741
734 }
735 showEditTools(); 742 showEditTools();
736 // Show filename in caption 743 // Show filename in caption
737 QString name = filer; 744 QString name = filer;