summaryrefslogtreecommitdiff
authorbipolar <bipolar>2002-03-06 00:58:32 (UTC)
committer bipolar <bipolar>2002-03-06 00:58:32 (UTC)
commit406bed0f501ea131ba31dbdecdde8c1fe8b15806 (patch) (side-by-side diff)
tree11f375b25df3534e7d8ecd4120ee2df53a9791d3
parentfcb139a744cfe6c9521962595f15cd8369251c56 (diff)
downloadopie-406bed0f501ea131ba31dbdecdde8c1fe8b15806.zip
opie-406bed0f501ea131ba31dbdecdde8c1fe8b15806.tar.gz
opie-406bed0f501ea131ba31dbdecdde8c1fe8b15806.tar.bz2
ljp: fixed setDocument opening the .desktop file and not the file it points too
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/apps/textedit/textedit.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/core/apps/textedit/textedit.cpp b/core/apps/textedit/textedit.cpp
index f138572..0f19da9 100644
--- a/core/apps/textedit/textedit.cpp
+++ b/core/apps/textedit/textedit.cpp
@@ -787,100 +787,103 @@ bool TextEdit::saveAs()
FileManager fm;
if ( !fm.saveFile( *doc, rt ) ) {
return false;
}
if( fileSaveDlg->filePermCheck->isChecked() ) {
filePermissions *filePerm;
filePerm = new filePermissions(this, "Permissions",true,0,(const QString &)fileNm);
filePerm->exec();
editor->setEdited( false );
if( filePerm)
delete filePerm;
}
}
}
if(fileSaveDlg)
delete fileSaveDlg;
return true;
}
void TextEdit::clear()
{
delete doc;
doc = 0;
editor->clear();
}
void TextEdit::updateCaption( const QString &name )
{
if ( !doc )
setCaption( tr("Text Editor") );
else {
QString s = name;
if ( s.isNull() )
s = doc->name();
if ( s.isEmpty() ) {
s = tr( "Unnamed" );
currentFileName=s;
}
setCaption( s + " - " + tr("Text Editor") );
}
}
void TextEdit::setDocument(const QString& fileref)
{
bFromDocView = TRUE;
+ qDebug("setDocument "+fileref);
+ bFromDocView = TRUE;
+ if(fileref.find(".desktop",0,TRUE) == -1) {
openFile(fileref);
-// bFromDocView = TRUE;
-// openFile(DocLnk(fileref));
-// showEditTools();
+ } else {
+ openFile(DocLnk(fileref));
+ }
}
void TextEdit::closeEvent( QCloseEvent *e )
{
if ( editorStack->visibleWidget() == fileSelector && !bFromDocView ) {
e->ignore();
repaint();
// fileRevert();
} else {
bFromDocView = FALSE;
e->accept();
}
}
void TextEdit::accept()
{
save();
close();
// fileOpen(); //godamn thats obnoxious! lemme out!!!
}
void TextEdit::changeFont() {
FontDatabase fdb;
QFont defaultFont=editor->font();
QFontInfo fontInfo(defaultFont);
Config cfg("TextEdit");
cfg.setGroup("Font");
QString family = cfg.readEntry("Family", fontInfo.family());
QString style = cfg.readEntry("Style", fdb.styleString(defaultFont));
int i_size = cfg.readNumEntry("Size", fontInfo.pointSize()/10);
QString charSet = cfg.readEntry("CharSet", QFont::encodingName( fontInfo.charSet()) );
defaultFont = fdb.font(family,style,i_size,charSet);
FontDialog *fontDlg;
fontDlg=new FontDialog(this,"FontDialog",TRUE);
fontDlg->exec();
QFont myFont=fontDlg->selectedFont;
editor->setFont( myFont);
delete fontDlg;
}
void TextEdit::editDelete()
{