From f736bf0ae774159a80a97b9492d7624e7caf07a3 Mon Sep 17 00:00:00 2001 From: llornkcor Date: Thu, 26 Dec 2002 03:48:32 +0000 Subject: added setDocFile function to change the filename needs more work --- (limited to 'noncore') diff --git a/noncore/apps/tinykate/libkate/document/katedocument.cpp b/noncore/apps/tinykate/libkate/document/katedocument.cpp index 10bc976..df1de8d 100644 --- a/noncore/apps/tinykate/libkate/document/katedocument.cpp +++ b/noncore/apps/tinykate/libkate/document/katedocument.cpp @@ -328,6 +328,7 @@ void KateDocument::openURL(const QString &filename) bool KateDocument::saveFile() { + QFile f( m_file ); if ( !f.open( IO_WriteOnly ) ) return false; // Error @@ -1925,7 +1926,8 @@ void KateDocument::updateLines(int startLine, int endLine, int flags, int cursor updateMaxLength(textLine); } endCtx = textLine->getContext(); - qDebug("DOHIGHLIGHT"); +// qDebug("DOHIGHLIGHT"); + ctxNum = m_highlight->doHighlight(ctxNum,textLine); textLine->setContext(ctxNum); line++; @@ -3030,6 +3032,12 @@ void KateDocument::setDocName (QString docName) emit nameChanged (this); } +void KateDocument::setDocFile (QString docFile) +{ + m_file = docFile; + emit fileNameChanged (); +} + void KateDocument::setMTime() { if (fileInfo && !fileInfo->fileName().isEmpty()) { diff --git a/noncore/apps/tinykate/libkate/document/katedocument.h b/noncore/apps/tinykate/libkate/document/katedocument.h index 220d188..356541f 100644 --- a/noncore/apps/tinykate/libkate/document/katedocument.h +++ b/noncore/apps/tinykate/libkate/document/katedocument.h @@ -454,6 +454,7 @@ class KateDocument: public Kate::Document QString docName () {return myDocName;}; void setDocName (QString docName); + void setDocFile (QString docFile); public slots: /** Reloads the current document from disk if possible */ @@ -528,11 +529,11 @@ class KateDocument: public Kate::Document private: - class KateDocPrivate - { - public: - bool hlSetByUser; - }; + class KateDocPrivate + { + public: + bool hlSetByUser; + }; // BCI: Add a real d-pointer in the next BIC release -- cgit v0.9.0.2