[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: branches/KDE/3.5/kdesdk/kbabel/commonui
From: Nicolas Goutte <nicolasg () snafu ! de>
Date: 2005-12-26 9:48:58
Message-ID: 1135590538.851679.1849.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 491441 by goutte:
As we can process only local files for @POFILEDIR@ process the PO file URL
by KIO::NetAccess::mostLocalURL (of course only if compile on KDE >= 3.5)
BUG:114041
(Bug #114041 is done, even without this commit. Tested with de.po of svn 1.2.3)
M +14 -1 context.cpp
M +3 -1 context.h
--- branches/KDE/3.5/kdesdk/kbabel/commonui/context.cpp #491440:491441
@@ -51,6 +51,8 @@
#include <klocale.h>
#include <kmessagebox.h>
#include <kurl.h>
+#include <kdeversion.h>
+#include <kio/netaccess.h>
#include <klibloader.h>
#include <ktrader.h>
@@ -60,6 +62,7 @@
#include <ktexteditor/viewcursorinterface.h>
SourceContext::SourceContext(QWidget *parent, KBabel::Project::Ptr project): \
QWidget(parent) + , m_parent( parent )
, _part(0)
, _view(0)
, _referenceCombo(0)
@@ -121,13 +124,23 @@
//kdDebug() << "GETTEXTCOMMENT:" << gettextComment << endl;
// Find the directory name of the PO file, if the PO file is local
+ // ### TODO: find a way to allow remote files too
QString poDir;
+#if KDE_IS_VERSION( 3, 5, 0 )
+ const KURL localUrl( KIO::NetAccess::mostLocalURL( urlPoFile, m_parent ) );
+ if ( localUrl.isLocalFile() )
+ {
+ const QFileInfo fi( localUrl.path() );
+ poDir = fi.dirPath( true );
+ }
+#else
if ( urlPoFile.isLocalFile() )
{
const QFileInfo fi( urlPoFile.path() );
poDir = fi.dirPath( true );
- kdDebug() << "PO FILE DIR: " << poDir << endl;
}
+#endif
+ //kdDebug() << "PO FILE DIR: " << poDir << endl;
QStringList prefixes;
QStringList paths = _project->settings()->paths();
--- branches/KDE/3.5/kdesdk/kbabel/commonui/context.h #491440:491441
@@ -105,7 +105,9 @@
*/
QValueList<ContextInfo> resolvePath( const QString& packageDir, const QString& \
packageName, const QString& gettextComment, const KURL& urlPoFile ); bool \
loadPart();
-
+
+ /// Parent widget (for KIO::NetAccess member functions)
+ QWidget* m_parent;
KTextEditor::Document* _part;
KTextEditor::View* _view;
QComboBox *_referenceCombo;
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic