Review Request 109605: Fix Plasmate loading local folders with the wrong API

Giorgos Tsiapaliokas terietor at gmail.com
Wed Mar 20 13:35:26 UTC 2013


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/109605/#review29549
-----------------------------------------------------------



plasmate/mainwindow.cpp
<http://git.reviewboard.kde.org/r/109605/#comment22034>

    a nicer way for this one is,
    
    if (radioButtonChecked.isEmpty()) {
        kDebug() << dir.FilePath(PROJECTRC) + "isn't valid, metadata.desktop cannot be checked";
        return;
    }
    
    when there is no .plasmateprojectrc file this method returns(check lines 917-920).
    
    The issue is that your .plasmateprojectrc
    file doesn't contain a radioButtonChecked entry or that the entry exists but has no value
    


- Giorgos Tsiapaliokas


On March 20, 2013, 12:46 p.m., Yuen Hoe Lim wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/109605/
> -----------------------------------------------------------
> 
> (Updated March 20, 2013, 12:46 p.m.)
> 
> 
> Review request for Plasma.
> 
> 
> Description
> -------
> 
> Noticed that when I use Plasmate to load some of my old python plasmoids (using import from local folder), the project gets loaded but the API type is immediately changed to "declarativeappletscript", breaking the python plasmoid. I dug into the code a bit and noticed that MainWindow::loadProject calls MainWindow::checkMetafile, which checks the projectrc file in the target folder for a "radioButtonChecked" entry and sets the API type in the real metadata file based on this value. Projects loaded from existing folders do not have the projectrc file and the one that gets auto-created does not have this "radioButtonChecked" entry, and so the API gets set (incorrectly) to the default type, which is "declarativeappletscript".
> 
> This is a quick patch that simply skips resetting the API in the metadatafile if the "radioButtonChecked" entry is not found. I realize that this may not be the ideal solution, but I'm not really sure how the whole projectrc vs metadata thing is supposed to work. I'll be happy to amend the fix if someone could tell me the "correct way" :)
> 
> 
> Diffs
> -----
> 
>   plasmate/mainwindow.cpp 13234ec 
> 
> Diff: http://git.reviewboard.kde.org/r/109605/diff/
> 
> 
> Testing
> -------
> 
> Some brief testing. It fixes the incorrect API bug without seeming to affect other load types afaik.
> 
> 
> Thanks,
> 
> Yuen Hoe Lim
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20130320/45899e7d/attachment-0001.html>


More information about the Plasma-devel mailing list