-rw-r--r-- | noncore/apps/tinykate/libkate/document/katedocument.cpp | 10 | ||||
-rw-r--r-- | noncore/apps/tinykate/libkate/document/katedocument.h | 11 |
2 files changed, 15 insertions, 6 deletions
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 @@ -325,12 +325,13 @@ void KateDocument::openURL(const QString &filename) return ; } bool KateDocument::saveFile() { + QFile f( m_file ); if ( !f.open( IO_WriteOnly ) ) return false; // Error QTextStream stream(&f); @@ -1922,13 +1923,14 @@ void KateDocument::updateLines(int startLine, int endLine, int flags, int cursor if (textLine==0) kdDebug(13020)<<"****updateLines()>> error textLine==0"<<endl; if (line <= endLine && line != cursorY) { if (flags & KateView::cfRemoveSpaces) textLine->removeSpaces(); updateMaxLength(textLine); } endCtx = textLine->getContext(); - qDebug("DOHIGHLIGHT"); +// qDebug("DOHIGHLIGHT"); + ctxNum = m_highlight->doHighlight(ctxNum,textLine); textLine->setContext(ctxNum); line++; } while ((buffer->line(line)!=0) && (line <= endLine || endCtx != ctxNum)); // kdDebug(13020)<<"updateLines :: while loop left"<<endl; tagLines(startLine, line - 1); @@ -3027,12 +3029,18 @@ void KateDocument::guiActivateEvent( KParts::GUIActivateEvent *ev ) void KateDocument::setDocName (QString docName) { myDocName = docName; emit nameChanged (this); } +void KateDocument::setDocFile (QString docFile) +{ + m_file = docFile; + emit fileNameChanged (); +} + void KateDocument::setMTime() { if (fileInfo && !fileInfo->fileName().isEmpty()) { fileInfo->refresh(); mTime = fileInfo->lastModified(); } 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 @@ -451,12 +451,13 @@ class KateDocument: public Kate::Document void isModOnHD(bool forceReload=false); uint docID () {return myDocID;}; QString docName () {return myDocName;}; void setDocName (QString docName); + void setDocFile (QString docFile); public slots: /** Reloads the current document from disk if possible */ void reloadFile(); private slots: @@ -525,17 +526,17 @@ class KateDocument: public Kate::Document public slots: void applyWordWrap (); private: - class KateDocPrivate - { - public: - bool hlSetByUser; - }; + class KateDocPrivate + { + public: + bool hlSetByUser; + }; // BCI: Add a real d-pointer in the next BIC release static QPtrDict<KateDocPrivate>* d_ptr; static void cleanup_d_ptr() { |