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

Fuzzy clock in KDE 4.8.3

Tags: None
(comma "," separated)
petern
Registered Member
Posts
27
Karma
0
OS

Fuzzy clock in KDE 4.8.3

Sun Aug 26, 2012 10:23 pm
Having just upgraded to KDE 4.8.3 from 4.6.5 on a Linux platform, I found that the fuzzy clock widget was not recognized. A new download of the widget gave the following error when I tried to add it to the panel:

Error in contents/code/main.js on line 325
TypeError: Result of expression is 'plasmoid.formFactor' [0] is not a function

This particular widget used to be very useful as a desktop item, so is there any way it can be reinstated for the current version of KDE?
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS

Re: Fuzzy clock in KDE 4.8.3

Mon Aug 27, 2012 2:27 am
Did Fuzzy Clock Widget ship with KDE, or was it downloaded from KDE-Apps.org?


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
petern
Registered Member
Posts
27
Karma
0
OS

Re: Fuzzy clock in KDE 4.8.3

Mon Aug 27, 2012 10:39 am
My recollection (a little fuzzy now, after all this time!) is that in KDE 4.6.5 it had to be downloaded from the list provided from instructions which correspond to the current 'Get New Widgets/Download new Plasma widgets' (that's how I accessed the error-prone version under 4.8.3).
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS

Re: Fuzzy clock in KDE 4.8.3

Mon Aug 27, 2012 10:50 am
Okay, that is a downloaded applet. I can confirm this on KDE Trunk - unfortunately you will need to contact the author of the applet to get this fixed.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
Minio
Registered Member
Posts
177
Karma
1
OS

Re: Fuzzy clock in KDE 4.8.3

Mon Aug 27, 2012 6:59 pm
I don't want to bash around and say that KDE is buggy, but there definitely something changed in KDE/Qt JavaScript bindings between 4.6 and 4.8.

Take this simple code for example:
Code: Select all
layout = new LinearLayout(plasmoid);

label = new Label();
layout.addItem(label);

if (plasmoid.formFactor() == Vertical) {
    layout.setOrientation(QtVertical);
} else {
    layout.setOrientation(QtHorizontal);
}

plasmoid.dataUpdated = function(name, data) {

      label.text = data.Time;
}

dataEngine("time").connectSource("Local", plasmoid, 500);

(This goes to main.js in plasmoid tree.)

It was copy-pasted from KDE documentation:
http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/DataEngine#Connecting_Engines_to_plasmoid.dataUpdated
http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/CheatSheet#Basics
This will produce the same error as yours.
Also, layout.setOrientation will complain about empty string, which means that QtVertical is not available anymore.

I am afraid there is not much you can do about it. We would definitely use some developer skill here - someone who can dig into source code and understand what is happening under the hood.


Best regards
Mirosław Zalewski
User avatar
Hans
Administrator
Posts
3304
Karma
24
OS

Re: Fuzzy clock in KDE 4.8.3

Mon Aug 27, 2012 8:38 pm
@petern:
Which distro do you use? There should be a fuzzy clock widget in kdeplasma-addons, it works fine here (4.8.4).

@Minio:
The documentation is probably out of date. Not sure what to do about it - maybe send a message to plasma-devel mailing list (@kde.org)?


Problem solved? Please click on "Accept this answer" below the post with the best answer to mark your topic as solved.

10 things you might want to do in KDE | Open menu with Super key | Mouse shortcuts
petern
Registered Member
Posts
27
Karma
0
OS

Re: Fuzzy clock in KDE 4.8.3

Mon Aug 27, 2012 10:35 pm
@hans: PCLinuxOS 2012, latest apt upgrade at 26th August 2012, which included the shift to KDE 4.8.3. Everything went well (including the migration of all e-mail folder contents from the old Kmail to Kmail2) apart from the fuzzy clock problem.
User avatar
Hans
Administrator
Posts
3304
Karma
24
OS

Re: Fuzzy clock in KDE 4.8.3

Mon Aug 27, 2012 10:51 pm
I guess you use this one? http://kde-look.org/content/show.php/Fu ... tent=96937

Try to install the official one from your package manager.


Problem solved? Please click on "Accept this answer" below the post with the best answer to mark your topic as solved.

10 things you might want to do in KDE | Open menu with Super key | Mouse shortcuts
petern
Registered Member
Posts
27
Karma
0
OS

Re: Fuzzy clock in KDE 4.8.3

Tue Aug 28, 2012 9:01 pm
@hans:

The fuzzy clock plasmoid I downloaded via Panel Options/Add Widgets was stored at the following location:

~/.kde4/share/apps/plasma/plasmoids/script-fuzzy-clock/

This is the one which when dragged to the desktop gave the error message I reported initially. The PCLinuxOS distro doesn't appear to contain the fuzzy clock.

The actual line of code giving the problem is:

Line 325: var form_factor = plasmoid.formFactor();

which as far as I can see is intended to pick up the plasmoid form factor from the Plasma system (although I may be wrong about this as my javascript skills are fairly primitive). Certainly, the function plasmoid.formFactor() is not defined within the javascript of the fuzzy clock script itself, although there is another instance of identical code to line 325 at line 291 of the script.

Can you see any easy fix?
User avatar
Hans
Administrator
Posts
3304
Karma
24
OS

Re: Fuzzy clock in KDE 4.8.3  Topic is solved

Tue Aug 28, 2012 9:35 pm
Do you have a package that's called "kdeplasma-addons" or something similar?

Unfortunately I'm don't know anything about scripted widgets, the bug is probably due to a change in the API.


Problem solved? Please click on "Accept this answer" below the post with the best answer to mark your topic as solved.

10 things you might want to do in KDE | Open menu with Super key | Mouse shortcuts
petern
Registered Member
Posts
27
Karma
0
OS

Re: Fuzzy clock in KDE 4.8.3

Tue Aug 28, 2012 10:11 pm
Brilliant, Hans!!! Now I've got my friendly fuzzy clock back. Grateful thanks.


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]