summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-03-13 01:05:41 (UTC)
committer llornkcor <llornkcor>2002-03-13 01:05:41 (UTC)
commitfc49c34cfd2ce2adad2920daa368b25f42b8bad7 (patch) (side-by-side diff)
tree8e5b7397427dcc0ab53d4090d72af2a38066f040
parent8e9330a8626076a3dd289a1abbe218eccd3a1784 (diff)
downloadopie-fc49c34cfd2ce2adad2920daa368b25f42b8bad7.zip
opie-fc49c34cfd2ce2adad2920daa368b25f42b8bad7.tar.gz
opie-fc49c34cfd2ce2adad2920daa368b25f42b8bad7.tar.bz2
fixed err when openinging a file from Docs tab, the edited asterik wasn't being set
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/apps/textedit/textedit.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/core/apps/textedit/textedit.cpp b/core/apps/textedit/textedit.cpp
index dafe1dc..f031a0f 100644
--- a/core/apps/textedit/textedit.cpp
+++ b/core/apps/textedit/textedit.cpp
@@ -832,96 +832,99 @@ bool TextEdit::saveAs()
}
}
}
editor->setEdited( FALSE);
edited1=FALSE;
edited=FALSE;
if(caption().left(1)=="*")
setCaption(caption().right(caption().length()-1));
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);
} else {
openFile(DocLnk(fileref));
}
+ editor->setEdited(TRUE);
+ edited1=FALSE;
+ edited=TRUE;
}
void TextEdit::closeEvent( QCloseEvent *e )
{
if ( editorStack->visibleWidget() == fileSelector && !bFromDocView ) {
e->ignore();
repaint();
// fileRevert();
} else {
bFromDocView = FALSE;
e->accept();
}
}
void TextEdit::accept()
{
QString file = doc->file();
if (file.find("_.txt",0,TRUE) ==-1)
save();
else {
QFile(file).remove();
}
exit(0);
}
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;