[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdeedu/kvoctrain/kvoctrain
From:       Peter Hedlund <peter () peterandlinda ! com>
Date:       2004-11-17 22:08:35
Message-ID: 20041117220835.A791916DD0 () office ! kde ! org
[Download RAW message or body]

CVS commit by hedlund: 

Use the filename as window caption if no document title has been specified.
BUG:93314


  M +2 -4      kva_io.cpp   1.45
  M +2 -4      kvt-core/kvd_rh_kvtml.cpp   1.16
  M +11 -10    kvt-core/kvoctraindoc.cpp   1.32


--- kdeedu/kvoctrain/kvoctrain/kvt-core/kvd_rh_kvtml.cpp  #1.15:1.16
@@ -1,6 +1,4 @@
 /***************************************************************************
 
-    $Id$
-
                    read header parts of a kvtml document
 
@@ -69,5 +67,5 @@ bool kvoctrainDoc::loadFromKvtMl (QTextS
 
   list<XmlAttribute>::const_iterator first =  elem.attributes ().begin ();
-  doctitle = i18n("untitled");
+  doctitle = i18n("Untitled");
   while (first != elem.attributes ().end ()) {
 

--- kdeedu/kvoctrain/kvoctrain/kvt-core/kvoctraindoc.cpp  #1.31:1.32
@@ -1,5 +1,4 @@
 /***************************************************************************
 
-    $Id$
 
                    maintain a kvoctrain document
@@ -86,5 +85,5 @@ void kvoctrainDoc::Init ()
   queryorg = "";
   querytrans = "";
-  doc_url.setFileName("");
+  doc_url.setFileName(i18n("Untitled"));
   doctitle = "";
   author = "";
@@ -95,4 +94,5 @@ kvoctrainDoc::kvoctrainDoc(QObject *pare
 {
   Init();
+  if (!url.isEmpty())
   doc_url = url;
 
@@ -106,5 +106,4 @@ kvoctrainDoc::kvoctrainDoc(QObject *pare
     {
       KMessageBox::error(0, i18n("<qt>Cannot open file<br><b>%1</b></qt>").arg(url.path()));
-      doc_url.setFileName("unknown.kvtml");
       return;
     }
@@ -187,9 +186,8 @@ bool kvoctrainDoc::saveAs (QObject *pare
 
   KURL tmp (url);
-  if (tmp.isEmpty())
-    tmp = doc_url;
-
-  if (tmp.isEmpty())
-    tmp.setFileName("unknown.kvtml");
+  if (title == i18n("Untitled"))
+    title = QString::null;
+  if (title == doc_url.fileName())
+    title = QString::null;
 
   if (ft == automatic) 
@@ -776,4 +774,7 @@ void kvoctrainDoc::setLessonsInQuery(vec
 QString kvoctrainDoc::getTitle() const
 {
+  if (doctitle.isEmpty())
+    return doc_url.fileName();
+  else
   return doctitle;
 }

--- kdeedu/kvoctrain/kvoctrain/kva_io.cpp  #1.44:1.45
@@ -1,6 +1,4 @@
 /***************************************************************************
 
-    $Id$
-
                          i/o part of kvoctrain
 
@@ -188,5 +186,5 @@ void kvoctrainApp::slotFileNew()
     delete doc;
     QString name = "";
-    doc = new kvoctrainDoc (this, KURL(name), separator, &paste_order);
+    doc = new kvoctrainDoc (this, 0 /*KURL(name)*/, separator, &paste_order);
     loadDocProps(doc);
     if (doc->numLangs() == 0) {
@@ -513,5 +511,5 @@ void kvoctrainApp::slotFileSave()
     commitEntryDlg(false);
 
-  if (doc->URL().isEmpty() ) {
+  if (doc->URL().fileName() == i18n("Untitled") ) {
     slotFileSaveAs();
     return;


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic