This forum has been archived. All content is frozen. Please use KDE Discuss instead.

kde4 patches..

Tags: None
(comma "," separated)
Ozzi
Registered Member
Posts
10
Karma
0

kde4 patches..

Mon Oct 29, 2007 7:33 pm
Hi!

I'm new here. Is it okey to post patches here if found something to fix?

eg, like:
Code: Select all
--- /home/kde-devel/svn/ktorrent_backup/plugins/zeroconf/torrentservice.cpp     2007-10-29 20:51:35.000000000 +0200
+++ /home/kde-devel/svn/ktorrent/plugins/zeroconf/torrentservice.cpp    2007-10-29 21:02:19.000000000 +0200
@@ -72,13 +72,7 @@

                if (!srv)
                {
-                       srv = new DNSSD::PublicService();
-
-                       srv->setPort(port);
-                       srv->setServiceName(name);
-                       srv->setType("_bittorrent._tcp");
-                       srv->setSubTypes(subtypes);
-
+                       srv = new DNSSD::PublicService(name,"_bittorrent._tcp",port,"",subtypes);
                        connect(srv,SIGNAL(published(bool)),this,SLOT(onPublished(bool)));
                        srv->publishAsync();
                }


yes, that's from kde4 trunk..

(it didn't compile at least in my box before that little fix)
George
Moderator
Posts
5421
Karma
1

Mon Oct 29, 2007 8:05 pm
Did they change the API again ?

Guess it's time to update my KDE4 installation.

I will add the patch, when I have upgraded.
Ozzi
Registered Member
Posts
10
Karma
0

Tue Oct 30, 2007 6:00 pm
Two more api changes:

Code: Select all
--- /home/kde-devel/svn/ktorrent_backup/libktorrent/util/fileops.cpp    2007-10-30 10:46:46.000000000 +0200
+++ /home/kde-devel/svn/ktorrent/libktorrent/util/fileops.cpp   2007-10-30 11:15:50.000000000 +0200
@@ -25,6 +25,7 @@
 #include <errno.h>
 #include <klocale.h>
 #include <kio/netaccess.h>
+#include <kio/copyjob.h>
 #include <sys/stat.h>
 #include <sys/types.h>
 #include <fcntl.h>
@@ -95,7 +96,8 @@
        void Move(const QString & src,const QString & dst,bool nothrow)
        {
        //      Out() << "Moving " << src << " -> " << dst << endl;
-               if (!KIO::NetAccess::move(KUrl(src),KUrl(dst),0))
+               KIO::CopyJob *mv = KIO::move(KUrl(src),KUrl(dst));
+               if (!KIO::NetAccess::synchronousRun(mv , 0))
                {
                        if (!nothrow)
                                throw Error(i18n("Cannot move %1 to %2: %3",
@@ -111,7 +113,8 @@

        void CopyFile(const QString & src,const QString & dst,bool nothrow)
        {
-               if (!KIO::NetAccess::file_copy(KUrl(src),KUrl(dst)))
+               KIO::CopyJob *cp = KIO::copy(KUrl(src),KUrl(dst));
+               if (!KIO::NetAccess::synchronousRun(cp , 0))
                {
                        if (!nothrow)
                                throw Error(i18n("Cannot copy %1 to %2: %3",
@@ -127,7 +130,8 @@

        void CopyDir(const QString & src,const QString & dst,bool nothrow)
        {
-               if (!KIO::NetAccess::dircopy(KUrl(src),KUrl(dst),0))
+               KIO::CopyJob *cp = KIO::copy(KUrl(src),KUrl(dst));
+                if (!KIO::NetAccess::synchronousRun(cp , 0))
                {
                        if (!nothrow)
                                throw Error(i18n("Cannot copy %1 to %2: %3",


and,

Code: Select all
--- /home/kde-devel/svn/ktorrent_backup/libktorrent/pluginmanager.cpp   2007-10-30 12:42:47.000000000 +0200
+++ /home/kde-devel/svn/ktorrent/libktorrent/pluginmanager.cpp  2007-10-30 15:05:29.000000000 +0200
@@ -60,18 +60,8 @@
                for(iter = offers.begin(); iter != offers.end(); ++iter)
                {
                        KService::Ptr service = *iter;
-                       Plugin* plugin = 0;
-
-                       KLibrary *library = KLibLoader::self()->library(service->library().toLocal8Bit());
-                       if (!library)
-                               continue;
-
-                       KLibFactory *factory = library->factory();
-                       if (!factory)
-                               continue;
-
-                       plugin = dynamic_cast<kt::Plugin*>(factory->create(0,"kt::Plugin"));
-                       if (!plugin)
+                       Plugin* plugin = service->createInstance<kt::Plugin>();
+                       if (!plugin)
                                continue;

                        if (!plugin->versionCheck(kt::VERSION_STRING))
@@ -81,8 +71,6 @@
                                                .arg(service->library()) << endl;

                                delete plugin;
-                               // unload the library again, no need to have it loaded
-                               KLibLoader::self()->unloadLibrary(service->library().toLocal8Bit());
                                continue;
                        }
                        unloaded.insert(plugin->getName(),plugin);


I hope these are right, at least everything seems to work same way after those fixes. :)
George
Moderator
Posts
5421
Karma
1

Thu Nov 01, 2007 10:13 am
svn upped my entire KDE4 installation and recompiled.

Then I compiled KT and I didn't get any errors.

What kind of KDE4 version are you exactly using ?

I usually develop against the latest API version, so until the whole API becomes stable (which should start to happen with beta 4), you need to keep KDE4 up to date.
Ozzi
Registered Member
Posts
10
Karma
0

Thu Nov 01, 2007 10:59 am
That compile halt (and deprecated warnings) was Sunday svn version. (I usually update it every weekend)

Yesturday I updated again my kde4 installation from svn, and today I got new fresh copy of KT from svn.

So, now both are latest's that I can do.

Still same error and warnings again. So, now both are latest's that I can do.


Code: Select all
[ 19%] Building CXX object libktorrent/CMakeFiles/ktcore.dir/util/fileops.o
/home/kde-devel/svn/ktorrent/libktorrent/util/fileops.cpp: In function 'void bt::Move(const QString&, const QString&, bool)':
/home/kde-devel/svn/ktorrent/libktorrent/util/fileops.cpp:98: warning: 'move' is deprecated (declared at /usr/kde/svn/include/kio/netaccess.h:214)


Code: Select all
[ 47%] Building CXX object libktorrent/CMakeFiles/ktcore.dir/pluginmanager.o
/home/kde-devel/svn/ktorrent/libktorrent/pluginmanager.cpp: In member function 'void kt::PluginManager::loadPluginList()':
/home/kde-devel/svn/ktorrent/libktorrent/pluginmanager.cpp:65: warning: 'self' is deprecated (declared at /usr/kde/svn/include/klibloader.h:136)
/home/kde-devel/svn/ktorrent/libktorrent/pluginmanager.cpp:69: warning: 'factory' is deprecated (declared at /usr/kde/svn/include/klibrary.h:57)
/home/kde-devel/svn/ktorrent/libktorrent/pluginmanager.cpp:73: warning: 'create' is deprecated (declared at /usr/kde/svn/include/kpluginfactory.h:339)
/home/kde-devel/svn/ktorrent/libktorrent/pluginmanager.cpp:85: warning: 'self' is deprecated (declared at /usr/kde/svn/include/klibloader.h:136)


Code: Select all
[ 68%] Building CXX object plugins/zeroconf/CMakeFiles/ktzeroconfplugin.dir/torrentservice.o
/home/kde-devel/svn/ktorrent/plugins/zeroconf/torrentservice.cpp:50: warning: unused parameter 'wjob'
Linking CXX shared module ../../lib/ktzeroconfplugin.so
CMakeFiles/ktzeroconfplugin.dir/torrentservice.o: In function `kt::TorrentService::start()':
/home/kde-devel/svn/ktorrent/plugins/zeroconf/torrentservice.cpp:80: undefined reference to `DNSSD::PublicService::setSubTypes(QStringList const&)'
collect2: ld returned 1 exit status
make[2]: *** [lib/ktzeroconfplugin.so] Virhe 1
make[1]: *** [plugins/zeroconf/CMakeFiles/ktzeroconfplugin.dir/all] Virhe 2
make: *** [all] Virhe 2
George
Moderator
Posts
5421
Karma
1

Fri Nov 02, 2007 11:47 am
If you look at the documentation, DNSSD::PublicService::setSubTypes exists. (see http://api.kde.org/4.0-api/kdelibs-apidocs/dnssd/html/classDNSSD_1_1PublicService.html)

So maybe you are linking with the wrong dnssd library (the one from KDE3) ?

I will see if I can commit the other patches, to get rid of those warnings.
Ozzi
Registered Member
Posts
10
Karma
0

Fri Nov 02, 2007 12:02 pm
George wrote:If you look at the documentation, DNSSD::PublicService::setSubTypes exists. (see http://api.kde.org/4.0-api/kdelibs-apidocs/dnssd/html/classDNSSD_1_1PublicService.html)

So maybe you are linking with the wrong dnssd library (the one from KDE3) ?

I will see if I can commit the other patches, to get rid of those warnings.


Yeah, I'll re-check that dnnsd early in next week.
I'll do another machine, only kde4 installation, for my dev machine, so no more wrong library possibilities.
Ozzi
Registered Member
Posts
10
Karma
0

Tue Nov 06, 2007 8:17 pm
Well, now I have another box running only kde4. And its builded from todays svn, and same DNNSD error still occurred.

I have Gentoo, and kde4 is builded from layman/kde ebuilds, but those get sources from anonsvn.kde.org. QT is version 4.3.2.

KT was first thing that I try compile after I get kde4 running.

Any ideas?



[/code]
mactalla
Registered Member
Posts
13
Karma
0
OS

Thu Nov 08, 2007 12:25 am
FWIW, on Kubuntu 7.10, with packaged Qt 4.3 and KDE4 from svn by following the instructions on techbase compiled ktorrent without error on my system. I did notice quite a number of warnings fly past, but nothing fatal.
Ozzi
Registered Member
Posts
10
Karma
0

Thu Nov 08, 2007 4:45 am
grr, where's the diffirence.. :evil:

I have gcc-4.2.2 and CFLAGS & CXXFLAGS are "-O2 -march=pentium4 -pipe -fomit-frame-pointer". There's nothing special, as there is nothing special in whole box, just pure and simpliest install. Hmm.. maybe it's there. I do have only kdelibs, kdepimlibs and kdebase and their deps installed. Should there be something more? (pls, do not say that its documented somewhere :oops: )

Is there any Gentoo users who can try to compile SVN version too?

EDIT: Yesturday I installed rest of kde4 and now KT compiles without errors. Still I'm confused. With that fix (in a first place) KT compiles with "minimal installation" and works quite well.


Bookmarks



Who is online

Registered users: Bing [Bot], claydoh, Google [Bot], rblackwell