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

List:       kde-commits
Subject:    [kate] ktexteditor: Add print() method to the documents D-Bus
From:       Christian Loose <christian.loose () hamburg ! de>
Date:       2011-08-19 17:20:09
Message-ID: 20110819172009.40632A6078 () git ! kde ! org
[Download RAW message or body]

Git commit b375424edb2e73a0abaa5452bd2cb5bede92533b by Christian Loose.
Committed on 16/08/2011 at 22:17.
Pushed by cloose into branch 'master'.

Add print() method to the documents D-Bus interface

Add print() method to the KTextEditor::Document interface and
expose it on the D-Bus session bus.

example:
qdbus org.kde.kate-7762 /Kate/Document/1 print
FEATURE: 246440
FIXED-IN: 4.8.0

M  +4    -0    ktexteditor/document.cpp
M  +1    -0    ktexteditor/documentadaptor_p.h
M  +5    -0    ktexteditor/document.h

http://commits.kde.org/kate/b375424edb2e73a0abaa5452bd2cb5bede92533b

diff --git a/ktexteditor/document.cpp b/ktexteditor/document.cpp
index ba717a7..9893a66 100644
--- a/ktexteditor/document.cpp
+++ b/ktexteditor/document.cpp
@@ -81,6 +81,10 @@ int DocumentAdaptor::totalCharacters() const {
   return m_document->totalCharacters();
 }
 
+bool DocumentAdaptor::print() {
+  return m_document->print();
+}
+
 int DocumentAdaptor::lineLength(int line) const {
   return m_document->lineLength(line);
 }
diff --git a/ktexteditor/document.h b/ktexteditor/document.h
index 8702b16..6a611eec 100644
--- a/ktexteditor/document.h
+++ b/ktexteditor/document.h
@@ -278,6 +278,11 @@ class KTEXTEDITOR_EXPORT Document : public KParts::ReadWritePart
      */
     virtual bool documentSaveAs () = 0;
 
+    /**
+     * Print the current file.
+     */
+    virtual bool print () = 0;
+    
  Q_SIGNALS:
     /**
     * This signal should be emitted after a document has been saved to disk or for \
                remote files uploaded.
diff --git a/ktexteditor/documentadaptor_p.h b/ktexteditor/documentadaptor_p.h
index af6846a..4395ce2 100644
--- a/ktexteditor/documentadaptor_p.h
+++ b/ktexteditor/documentadaptor_p.h
@@ -63,6 +63,7 @@ namespace KTextEditor {
 			QString text() const;
 			int lines() const;
 			int totalCharacters() const;
+            bool print();
 		private:
 			Document *m_document;
 	};


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

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