summaryrefslogtreecommitdiff
path: root/core
Side-by-side diff
Diffstat (limited to 'core') (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
@@ -380,13 +380,12 @@ TextEdit::TextEdit( QWidget *parent, const char *name, WFlags f )
int size = cfg. readNumEntry ( "Size", defaultFont. pointSize ( ));
int weight = cfg. readNumEntry ( "Weight", defaultFont. weight ( ));
bool italic = cfg. readBoolEntry ( "Italic", defaultFont. italic ( ));
defaultFont = QFont ( family, size, weight, italic );
editor-> setFont ( defaultFont );
-
// updateCaption();
cfg.setGroup ( "View" );
promptExit = cfg.readBoolEntry ( "PromptExit", false );
openDesktop = cfg.readBoolEntry ( "OpenDesktop", true );
@@ -696,45 +695,53 @@ void TextEdit::openDotFile( const QString &f ) {
void TextEdit::openFile( const QString &f ) {
qDebug("filename is "+ f);
QString filer;
QFileInfo fi( f);
// bFromDocView = true;
- if(f.find(".desktop",0,true) != -1 && !openDesktop ) {
+ if(f.find(".desktop",0,true) != -1 && !openDesktop )
+ {
switch ( QMessageBox::warning(this,tr("Text Editor"),
tr("Text Editor has detected<BR>you selected a <B>.desktop</B>
file.<BR>Open <B>.desktop</B> file or <B>linked</B> file?"),
- tr(".desktop File"),tr("Linked Document"),0,1,1) ) {
- case 0:
+ tr(".desktop File"),tr("Linked Document"),0,1,1) )
+ {
+ case 0: //desktop
filer = f;
break;
- case 1:
+ case 1: //linked
DocLnk sf(f);
filer = sf.file();
break;
+ };
}
- } else if(fi.baseName().left(1) == "") {
+ else if(fi.baseName().left(1) == "")
+ {
+ qDebug("opening dotfile");
currentFileName=f;
openDotFile(currentFileName);
- } else {
+ return;
+ }
+ else
+ {
DocLnk sf(f);
filer = sf.file();
if(filer.right(1) == "/")
filer = f;
+ }
DocLnk nf;
nf.setType("text/plain");
nf.setFile(filer);
currentFileName=filer;
nf.setName(fi.baseName());
openFile(nf);
qDebug("openFile string "+currentFileName);
- }
showEditTools();
// Show filename in caption
QString name = filer;
int sep = name.findRev( '/' );
if ( sep > 0 )
name = name.mid( sep+1 );