Bug 108701 - DCOP bindings in Perl: QStringList not working properly
Summary: DCOP bindings in Perl: QStringList not working properly
Status: RESOLVED UNMAINTAINED
Alias: None
Product: bindings
Classification: Developer tools
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: kde-bindings
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-07 15:17 UTC by Sven Hergenhahn
Modified: 2010-01-20 21:15 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sven Hergenhahn 2005-07-07 15:17:08 UTC
Version:            (using KDE KDE 3.4.0)

Hi,

I'm trying to get juk to add a list of files to the Play Queue with Perl.

------------------------------------------------------------------------
use DCOP;
my $client = new DCOP();
$client->attach();

my $collection = $client->createObject("juk", "Collection");
my $player = $client->createObject("juk", "Player");
my @files = ('/path/to/foo.mp3', '/path/to/bar.mp3');

# this works fine (passing one file only)
my $playlistsRef = $collection->openFile("Play Queue", "/path/to/foo.mp3");

# this does as well 
my $playlistsRef;
foreach my $file (@files) {
$playlistsRef = $collection->openFile("Play Queue", $file);
}

# but this doesn't (although it "should")
my $playlistsRef2 = $collection->openFile("Play Queue", @files);
------------------------------------------------------------------------------------------

The error is:

Function "juk.Collection.openFile()" doesn't exist. at /usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi/DCOP/Object.pm line 24.
Process perl exited with code 9

According to the documentation, a QStringList is represented by an array in Perl, so in my opinion,
 
$collection->openFile("Play Queue",  @files);

should work. openString in juk either takes a QString (works) or a QStringList (works on the shell but not in Perl)

Any ideas?

Thanks,
Sven
Comment 1 Scott Wheeler 2005-07-07 15:37:49 UTC
Uhm, Kopete is the instant messanger.  You want the Perl DCOP bindings.  ;-)
Comment 2 Sven Hergenhahn 2005-07-07 17:42:15 UTC
Sorry, wrong developer group, this is the correct one: Bug 108706
Comment 3 Scott Wheeler 2005-07-07 17:54:51 UTC
Uhm, I already switched the component on this one to the appropriate one.  KDevelop is not the right place.
Comment 4 Richard Dale 2005-07-08 16:50:46 UTC
The problem is that the Perl DCOP bindings only support method overloading 
resolution based on the number of args. It doesn't resolve overloading based 
on the type of the args at the moment.

You need to use $client->call() and specify the type signature of the method 
that takes a QStringList. I would expect this to work:

$client->call("juk", "Player", "openFile(QStringList)", at files);

-- Richard
Comment 5 Sven Hergenhahn 2005-07-08 17:04:05 UTC
use DCOP;
my $client = new DCOP();
$client->attach();
my @files = ("foo.mp3", "bar.mp3");
$client->call("juk", "Player", "openFile(QString, QStringList)", 'Play Queue', @files);

Error:
DCOP: Not reference at dcop.pl line 54.
Process perl exited with code 9
Comment 6 Sven Hergenhahn 2005-07-08 17:23:14 UTC
$client->call("juk", "Player", 'openFile(QString, QStringList)', 'Play Queue', \@files);

This exits correctly with 0, but the files do not show up in the Playlist.

Do I miss anything?

Thanks,
Sven
Comment 7 Dario Andres 2010-01-20 21:15:30 UTC
Closing as DCOP is unmaintained.