summaryrefslogtreecommitdiff
path: root/noncore
Unidiff
Diffstat (limited to 'noncore') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/tinykate/libkate/document/katedocument.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/noncore/apps/tinykate/libkate/document/katedocument.cpp b/noncore/apps/tinykate/libkate/document/katedocument.cpp
index a70f3aa..b82a86a 100644
--- a/noncore/apps/tinykate/libkate/document/katedocument.cpp
+++ b/noncore/apps/tinykate/libkate/document/katedocument.cpp
@@ -344,49 +344,54 @@ bool KateDocument::saveFile()
344 int line = 0; 344 int line = 0;
345 while(true) 345 while(true)
346 { 346 {
347 stream << getTextLine(line)->getString(); 347 stream << getTextLine(line)->getString();
348 line++; 348 line++;
349 if (line >= maxLine) break; 349 if (line >= maxLine) break;
350 350
351 if (eolMode == KateDocument::eolUnix) stream << "\n"; 351 if (eolMode == KateDocument::eolUnix) stream << "\n";
352 else if (eolMode == KateDocument::eolDos) stream << "\r\n"; 352 else if (eolMode == KateDocument::eolDos) stream << "\r\n";
353 else if (eolMode == KateDocument::eolMacintosh) stream << '\r'; 353 else if (eolMode == KateDocument::eolMacintosh) stream << '\r';
354 }; 354 };
355 f.close(); 355 f.close();
356 356
357 fileInfo->setFile (m_file); 357 fileInfo->setFile (m_file);
358 setMTime(); 358 setMTime();
359 359
360 if (!(d(this)->hlSetByUser)) 360 if (!(d(this)->hlSetByUser))
361 { 361 {
362 int hl = hlManager->wildcardFind( m_file ); 362 int hl = hlManager->wildcardFind( m_file );
363 363
364 setHighlight(hl); 364 setHighlight(hl);
365 } 365 }
366 emit fileNameChanged (); 366 emit fileNameChanged ();
367 367
368 return (f.status() == IO_Ok); 368 if(f.status() == IO_Ok) {
369 setModified(false);
370 return true;
371 }
372 else
373 return false;
369} 374}
370 375
371KTextEditor::View *KateDocument::createView( QWidget *parent, const char *name ) 376KTextEditor::View *KateDocument::createView( QWidget *parent, const char *name )
372{ 377{
373 return new KateView( this, parent, name); 378 return new KateView( this, parent, name);
374} 379}
375 380
376QString KateDocument::textLine( int line ) const 381QString KateDocument::textLine( int line ) const
377{ 382{
378 TextLine::Ptr l = getTextLine( line ); 383 TextLine::Ptr l = getTextLine( line );
379 if ( !l ) 384 if ( !l )
380 return QString(); 385 return QString();
381 386
382 return l->getString(); 387 return l->getString();
383} 388}
384 389
385void KateDocument::replaceLine(const QString& s,int line) 390void KateDocument::replaceLine(const QString& s,int line)
386{ 391{
387 remove_Line(line,false); 392 remove_Line(line,false);
388 insert_Line(s,line,true); 393 insert_Line(s,line,true);
389} 394}
390 395
391void KateDocument::insertLine( const QString &str, int l ) { 396void KateDocument::insertLine( const QString &str, int l ) {
392 insert_Line(str,l,true); 397 insert_Line(str,l,true);