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

List:       koffice-devel
Subject:    [patch] exp0rt method rename
From:       Kevin Krammer <kevin.krammer () gmx ! at>
Date:       2008-03-08 18:36:52
Message-ID: 200803081936.52976.kevin.krammer () gmx ! at
[Download RAW message or body]

[Attachment #2 (multipart/signed)]

[Attachment #4 (multipart/mixed)]


Hi,

the attached patch gets rid of the IMHO rather ugly "leet speak" exp0rt() name 
by changing the method name to exportDocument()
Also changes import to importDocument() for consistency.

Might not have caught all occurencies of import() since I don't have all the 
optional libraries for certain plugins installed.

Cheers,
Kevin

-- 
Kevin Krammer, KDE developer, xdg-utils developer
KDE user support, developer mentoring

["import_export_rename.diff" (text/x-diff)]

Index: tools/converter/koconverter.cpp
===================================================================
--- tools/converter/koconverter.cpp	(revision 783569)
+++ tools/converter/koconverter.cpp	(working copy)
@@ -44,7 +44,7 @@
     manager->setBatchMode( batch );
 
     QByteArray mime( outputFormat.toLatin1() );
-    KoFilter::ConversionStatus status = manager->exp0rt( uOut.path(), mime );
+    KoFilter::ConversionStatus status = manager->exportDocument( uOut.path(), mime \
);  progressObj.slotProgress(-1);
 
     delete manager;
Index: koshell/koshell_shell.cpp
===================================================================
--- koshell/koshell_shell.cpp	(revision 783569)
+++ koshell/koshell_shell.cpp	(working copy)
@@ -179,7 +179,7 @@
 
     KoFilterManager *manager = new KoFilterManager( url.path() );
     QByteArray mimetype;                                               // an empty \
                mimetype means, that the "nearest"
-    KoFilter::ConversionStatus status = manager->exp0rt( tmpFile.fileName(), \
mimetype ); // KOffice part will be chosen +    KoFilter::ConversionStatus status = \
manager->exportDocument( tmpFile.fileName(), mimetype ); // KOffice part will be \
chosen  delete manager;
 
     if ( status != KoFilter::OK || mimetype.isEmpty() ) {
@@ -207,7 +207,7 @@
   connect(newdoc, SIGNAL(completed()), this, SLOT(slotKSLoadCompleted()));
   connect(newdoc, SIGNAL(canceled( const QString & )), this, \
SLOT(slotKSLoadCanceled( const QString & )));  newdoc->addShell( this ); // used by \
                openUrl
-  bool openRet = (!isImporting ()) ? newdoc->openUrl(tmpUrl) : \
newdoc->import(tmpUrl); +  bool openRet = (!isImporting ()) ? newdoc->openUrl(tmpUrl) \
: newdoc->importDocument(tmpUrl);  if ( !openRet )
   {
       newdoc->removeShell(this);
@@ -273,7 +273,7 @@
 {
     KoDocument* newdoc = (KoDocument *)(sender());
 
-    // KoDocument::import() calls resetURL() too late...
+    // KoDocument::importDocument() calls resetURL() too late...
     // ...setRootDocument will show the URL...
     // So let's stop this from happening and the user will never know :)
     if (isImporting()) newdoc->resetURL ();
Index: krita/plugins/filters/fastcolortransfer/fastcolortransfer.cc
===================================================================
--- krita/plugins/filters/fastcolortransfer/fastcolortransfer.cc	(revision 783569)
+++ krita/plugins/filters/fastcolortransfer/fastcolortransfer.cc	(working copy)
@@ -111,7 +111,7 @@
 
     dbgPlugins << "Use as reference file : " << fileName;
     KisDoc2 d;
-    d.import(fileName);
+    d.importDocument(fileName);
     KisImageSP importedImage = d.image();
 
     if(importedImage)
Index: krita/plugins/viewplugins/separate_channels/kis_channel_separator.cc
===================================================================
--- krita/plugins/viewplugins/separate_channels/kis_channel_separator.cc	(revision \
                783569)
+++ krita/plugins/viewplugins/separate_channels/kis_channel_separator.cc	(working \
copy) @@ -278,7 +278,7 @@
                 dst->addNode(l->clone().data(), dst->rootLayer().data());
 
                 d.setOutputMimeType(mimefilter.toLatin1());
-                d.exp0rt(url);
+                d.exportDocument(url);
 
             }
 
Index: krita/ui/kis_layer_manager.cc
===================================================================
--- krita/ui/kis_layer_manager.cc	(revision 783569)
+++ krita/ui/kis_layer_manager.cc	(working copy)
@@ -895,7 +895,7 @@
     dst->addNode(l->clone(),dst->rootLayer(),KisLayerSP(0));
 
     d.setOutputMimeType(mimefilter.toLatin1());
-    d.exp0rt(url);
+    d.exportDocument(url);
 }
 
 bool KisLayerManager::activeLayerHasSelection()
Index: plugins/dockers/shapecollection/KoOdfCollectionLoader.cpp
===================================================================
--- plugins/dockers/shapecollection/KoOdfCollectionLoader.cpp	(revision 783569)
+++ plugins/dockers/shapecollection/KoOdfCollectionLoader.cpp	(working copy)
@@ -137,7 +137,7 @@
         if(!m_filterManager)
             m_filterManager = new \
KoFilterManager(QByteArray(KoOdf::mimeType(KoOdf::Graphics)));  \
                KoFilter::ConversionStatus status;
-        importedFile = m_filterManager->import(filepath, status);
+        importedFile = m_filterManager->importDocument(filepath, status);
         kDebug() << "File:" << filepath << "Import:" << importedFile;
 
         if(status != KoFilter::OK)
Index: kspread/flake/TableTool.cpp
===================================================================
--- kspread/flake/TableTool.cpp	(revision 783569)
+++ kspread/flake/TableTool.cpp	(working copy)
@@ -126,7 +126,7 @@
     if (file.isEmpty())
         return;
     d->tableShape->doc()->setModified(false);
-    if ( ! d->tableShape->doc()->import(file))
+    if ( ! d->tableShape->doc()->importDocument(file))
         return;
     updateSheetsList();
     if (Sheet* sheet = d->tableShape->sheet()) {
@@ -143,7 +143,7 @@
     QString file = KFileDialog::getSaveFileName(KUrl(), \
"application/vnd.oasis.opendocument.spreadsheet", 0, "Export");  if (file.isEmpty())
         return;
-    d->tableShape->doc()->exp0rt(file);
+    d->tableShape->doc()->exportDocument(file);
 }
 
 void TableTool::paint( QPainter& painter, const KoViewConverter& viewConverter )
Index: kspread/plugins/scripting/ScriptingModule.cpp
===================================================================
--- kspread/plugins/scripting/ScriptingModule.cpp	(revision 783569)
+++ kspread/plugins/scripting/ScriptingModule.cpp	(working copy)
@@ -177,12 +177,12 @@
 
 bool ScriptingModule::importUrl(const QString& url)
 {
-	return kspreadDoc()->import(url);
+	return kspreadDoc()->importDocument(url);
 }
 
 bool ScriptingModule::exportUrl(const QString& url)
 {
-	return kspreadDoc()->exp0rt(url);
+	return kspreadDoc()->exportDocument(url);
 }
 
 QObject* ScriptingModule::reader()
Index: libs/main/KoMainWindow.cpp
===================================================================
--- libs/main/KoMainWindow.cpp	(revision 783569)
+++ libs/main/KoMainWindow.cpp	(working copy)
@@ -684,7 +684,7 @@
     connect(newdoc, SIGNAL(completed()), this, SLOT(slotLoadCompleted()));
     connect(newdoc, SIGNAL(canceled( const QString & )), this, \
SLOT(slotLoadCanceled( const QString & )));  newdoc->addShell( this ); // used by \
                openUrl
-    bool openRet = (!isImporting ()) ? newdoc->openUrl(url) : newdoc->import(url);
+    bool openRet = (!isImporting ()) ? newdoc->openUrl(url) : \
newdoc->importDocument(url);  if(!openRet)
     {
         newdoc->removeShell(this);
@@ -1009,7 +1009,7 @@
                 }
                 else    // Export
                 {
-                    ret = pDoc->exp0rt( newURL );
+                    ret = pDoc->exportDocument( newURL );
 
                     if (ret)
                     {
Index: libs/main/KoFilterManager.cpp
===================================================================
--- libs/main/KoFilterManager.cpp	(revision 783569)
+++ libs/main/KoFilterManager.cpp	(working copy)
@@ -152,7 +152,7 @@
     delete d;
 }
 
-QString KoFilterManager::import( const QString& url, KoFilter::ConversionStatus& \
status ) +QString KoFilterManager::importDocument( const QString& url, \
KoFilter::ConversionStatus& status )  {
     // Find the mime type for the file to be imported.
     KUrl u;
@@ -247,7 +247,7 @@
     return QString();
 }
 
-KoFilter::ConversionStatus KoFilterManager::exp0rt( const QString& url, QByteArray& \
mimeType ) +KoFilter::ConversionStatus KoFilterManager::exportDocument( const \
QString& url, QByteArray& mimeType )  {
     bool userCancelled = false;
 
Index: libs/main/KoDocument.cpp
===================================================================
--- libs/main/KoDocument.cpp	(revision 783569)
+++ libs/main/KoDocument.cpp	(working copy)
@@ -345,7 +345,7 @@
     return view;
 }
 
-bool KoDocument::exp0rt( const KUrl & _url )
+bool KoDocument::exportDocument( const KUrl & _url )
 {
     bool ret;
 
@@ -356,8 +356,8 @@
     // be able to fake a File --> Export.  Can't do this in saveFile() because,
     // for a start, KParts has already set m_url and m_file and because we need
     // to restore the modified flag etc. and don't want to put a load on anyone
-    // reimplementing saveFile() (Note: import() and export() will remain
-    // non-virtual).
+    // reimplementing saveFile() (Note: importDocument() and exportDocument()
+    // will remain non-virtual).
     //
     KUrl oldURL = url ();
     QString oldFile = localFilePath ();
@@ -440,7 +440,7 @@
         if ( !d->filterManager )
             d->filterManager = new KoFilterManager( this );
 
-        KoFilter::ConversionStatus status = d->filterManager->exp0rt( \
localFilePath(), outputMimeType ); +        KoFilter::ConversionStatus status = \
d->filterManager->exportDocument( localFilePath(), outputMimeType );  ret = status == \
                KoFilter::OK;
         suppressErrorDialog = (status == KoFilter::UserCancelled || status == \
KoFilter::BadConversionGraph );  } else {
@@ -1395,11 +1395,11 @@
     return false;
 }
 
-bool KoDocument::import( const KUrl & _url )
+bool KoDocument::importDocument( const KUrl & _url )
 {
     bool ret;
 
-    kDebug (30003) <<"KoDocument::import url=" << _url.url();
+    kDebug (30003) << "url=" << _url.url();
     d->m_isImporting = true;
 
     // open...
@@ -1409,7 +1409,7 @@
     // File --> Import
     if (ret)
     {
-        kDebug (30003) <<"KoDocument::import success, resetting url";
+        kDebug (30003) << "success, resetting url";
         resetURL ();
         setTitleModified ();
     }
@@ -1537,7 +1537,7 @@
         if ( !d->filterManager )
             d->filterManager = new KoFilterManager( this );
         KoFilter::ConversionStatus status;
-        importedFile = d->filterManager->import( localFilePath(), status );
+        importedFile = d->filterManager->importDocument( localFilePath(), status );
         if ( status != KoFilter::OK )
         {
             QApplication::restoreOverrideCursor();
Index: libs/main/KoFilterManager.h
===================================================================
--- libs/main/KoFilterManager.h	(revision 783569)
+++ libs/main/KoFilterManager.h	(working copy)
@@ -64,8 +64,8 @@
     /**
      * Create a filter manager for a filter which wants to embed something.
      * The url it passes is the file to convert, obviously. You cannot use
-     * the @ref import() method -- use @ref exp0rt() to convert the file to
-     * the destination mimetype you prefer.
+     * the @ref importDocument() method -- use @ref exportDocument() to convert
+     * the file to the destination mimetype you prefer.
      *
      * @param url The file you want to export
      * @param mimetypeHint The mimetype of the file you want to export. You have
@@ -87,7 +87,7 @@
      * If the QString which is returned isEmpty() and the status is OK,
      * then we imported the file directly into the document.
      */
-    QString import( const QString& url, KoFilter::ConversionStatus& status );
+    QString importDocument( const QString& url, KoFilter::ConversionStatus& status \
);  /**
      * @brief Exports the given file/document to the specified URL/mimetype.
      *
@@ -95,7 +95,7 @@
      * and when the method returns @p mimeType contains this mimetype.
      * Oh, well, export is a C++ keyword ;)
      */
-    KoFilter::ConversionStatus exp0rt( const QString& url, QByteArray& mimeType );
+    KoFilter::ConversionStatus exportDocument( const QString& url, QByteArray& \
mimeType );  
 
 
Index: libs/main/KoFilter.cpp
===================================================================
--- libs/main/KoFilter.cpp	(revision 783569)
+++ libs/main/KoFilter.cpp	(working copy)
@@ -86,7 +86,7 @@
     savePartContents( &tempIn );
 
     KoFilterManager *manager = new KoFilterManager( tempIn.fileName(), from, m_chain \
                );
-    status = manager->exp0rt( QString(), to );
+    status = manager->exportDocument( QString(), to );
     delete manager;
 
     // Add the part to the current "stack frame", using the number as key
Index: libs/main/KoDocument.h
===================================================================
--- libs/main/KoDocument.h	(revision 783569)
+++ libs/main/KoDocument.h	(working copy)
@@ -169,7 +169,7 @@
      *       Open operation (in any reimplementation of openUrl() or openFile())
      *       call isImporting().
      */
-    bool import( const KUrl &url );
+    bool importDocument( const KUrl &url );
 
     /**
      * Saves the document as @p url without changing the state of the
@@ -181,7 +181,7 @@
      *       from an ordinary Save operation (in any reimplementation of
      *       saveFile()) call isExporting().
      */
-    bool exp0rt( const KUrl &url );
+    bool exportDocument( const KUrl &url );
 
     /**
      * @brief Sets whether the document can be edited or is read only.
Index: karbon/ui/KarbonView.cpp
===================================================================
--- karbon/ui/KarbonView.cpp	(revision 783569)
+++ karbon/ui/KarbonView.cpp	(working copy)
@@ -385,7 +385,7 @@
     {
         KoFilterManager man( part() );
         KoFilter::ConversionStatus status;
-        QString importedFile = man.import( fname, status );
+        QString importedFile = man.importDocument( fname, status );
         part()->mergeNativeFormat( importedFile );
         if( !importedFile.isEmpty() )
             unlink( QFile::encodeName( importedFile ) );


["signature.asc" (application/pgp-signature)]

_______________________________________________
koffice-devel mailing list
koffice-devel@kde.org
https://mail.kde.org/mailman/listinfo/koffice-devel


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

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