D26691: Optimize code when dropping files into the desktop

2020-02-04 Thread Tranter Madi
trmdi added a comment.


  In D26691#605802 , @jjazeix wrote:
  
  > Compilation fails: 
https://build.kde.org/view/Failing/job/Plasma/job/plasma-framework/job/kf5-qt5%20SUSEQt5.12/288/console
  >  Missing the new file in the CMakeLists.txt 
(https://cgit.kde.org/plasma-framework.git/tree/src/scriptengines/qml/CMakeLists.txt#n9)?
  >
  > Fixed in 
https://cgit.kde.org/plasma-framework.git/commit/?id=2ea27fb06887237d49c63f6b7e74702bffef57ea
  
  
  Thanks. :)

REPOSITORY
  R242 Plasma Framework (Library)

REVISION DETAIL
  https://phabricator.kde.org/D26691

To: trmdi, #plasma, mart, broulik, #vdg, davidedmundson
Cc: jjazeix, davidedmundson, anthonyfieroni, #plasma, kde-frameworks-devel, 
LeGast00n, GB_2, michaelh, ngraham, bruns


D26691: Optimize code when dropping files into the desktop

2020-02-03 Thread Johnny Jazeix
jjazeix added a comment.


  Compilation fails: 
https://build.kde.org/view/Failing/job/Plasma/job/plasma-framework/job/kf5-qt5%20SUSEQt5.12/288/console
  Missing the new file in the CMakeLists.txt?

REPOSITORY
  R242 Plasma Framework (Library)

REVISION DETAIL
  https://phabricator.kde.org/D26691

To: trmdi, #plasma, mart, broulik, #vdg, davidedmundson
Cc: jjazeix, davidedmundson, anthonyfieroni, #plasma, kde-frameworks-devel, 
LeGast00n, GB_2, michaelh, ngraham, bruns


D26691: Optimize code when dropping files into the desktop

2020-02-03 Thread Tranter Madi
This revision was automatically updated to reflect the committed changes.
Closed by commit R242:f8be3ea7102f: Optimize code when dropping files into the 
desktop (authored by trmdi).

REPOSITORY
  R242 Plasma Framework (Library)

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D26691?vs=74672=74975

REVISION DETAIL
  https://phabricator.kde.org/D26691

AFFECTED FILES
  src/scriptengines/qml/plasmoid/containmentinterface.cpp
  src/scriptengines/qml/plasmoid/containmentinterface.h
  src/scriptengines/qml/plasmoid/dropmenu.cpp
  src/scriptengines/qml/plasmoid/dropmenu.h

To: trmdi, #plasma, mart, broulik, #vdg, davidedmundson
Cc: davidedmundson, anthonyfieroni, #plasma, kde-frameworks-devel, LeGast00n, 
GB_2, michaelh, ngraham, bruns


D26691: Optimize code when dropping files into the desktop

2020-01-30 Thread Tranter Madi
trmdi added a comment.


  @mart
  Do you have any objection?

REPOSITORY
  R242 Plasma Framework (Library)

BRANCH
  improve-file-drop-menu (branched from master)

REVISION DETAIL
  https://phabricator.kde.org/D26691

To: trmdi, #plasma, mart, broulik, #vdg, davidedmundson
Cc: davidedmundson, anthonyfieroni, #plasma, kde-frameworks-devel, LeGast00n, 
GB_2, michaelh, ngraham, bruns


D26691: Optimize code when dropping files into the desktop

2020-01-30 Thread Tranter Madi
trmdi updated this revision to Diff 74672.
trmdi added a comment.


  - Rebase

REPOSITORY
  R242 Plasma Framework (Library)

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D26691?vs=74036=74672

BRANCH
  improve-file-drop-menu (branched from master)

REVISION DETAIL
  https://phabricator.kde.org/D26691

AFFECTED FILES
  src/scriptengines/qml/plasmoid/containmentinterface.cpp
  src/scriptengines/qml/plasmoid/containmentinterface.h
  src/scriptengines/qml/plasmoid/dropmenu.cpp
  src/scriptengines/qml/plasmoid/dropmenu.h

To: trmdi, #plasma, mart, broulik, #vdg, davidedmundson
Cc: davidedmundson, anthonyfieroni, #plasma, kde-frameworks-devel, LeGast00n, 
GB_2, michaelh, ngraham, bruns


D26691: Optimize code when dropping files into the desktop

2020-01-21 Thread Tranter Madi
trmdi edited the summary of this revision.

REPOSITORY
  R242 Plasma Framework (Library)

BRANCH
  improve-file-drop-menu

REVISION DETAIL
  https://phabricator.kde.org/D26691

To: trmdi, #plasma, mart, broulik, #vdg, davidedmundson
Cc: davidedmundson, anthonyfieroni, #plasma, kde-frameworks-devel, LeGast00n, 
GB_2, michaelh, ngraham, bruns


D26691: Optimize code when dropping files into the desktop

2020-01-21 Thread Tranter Madi
trmdi marked an inline comment as done.

REPOSITORY
  R242 Plasma Framework (Library)

BRANCH
  improve-file-drop-menu

REVISION DETAIL
  https://phabricator.kde.org/D26691

To: trmdi, #plasma, mart, broulik, #vdg, davidedmundson
Cc: davidedmundson, anthonyfieroni, #plasma, kde-frameworks-devel, LeGast00n, 
GB_2, michaelh, ngraham, bruns


D26691: Optimize code when dropping files into the desktop

2020-01-21 Thread Tranter Madi
trmdi updated this revision to Diff 74036.
trmdi marked 2 inline comments as done.
trmdi added a comment.


  - Address comment

REPOSITORY
  R242 Plasma Framework (Library)

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D26691?vs=74030=74036

BRANCH
  improve-file-drop-menu

REVISION DETAIL
  https://phabricator.kde.org/D26691

AFFECTED FILES
  src/scriptengines/qml/plasmoid/containmentinterface.cpp
  src/scriptengines/qml/plasmoid/containmentinterface.h
  src/scriptengines/qml/plasmoid/dropmenu.cpp
  src/scriptengines/qml/plasmoid/dropmenu.h

To: trmdi, #plasma, mart, broulik, #vdg, davidedmundson
Cc: davidedmundson, anthonyfieroni, #plasma, kde-frameworks-devel, LeGast00n, 
GB_2, michaelh, ngraham, bruns


D26691: Optimize code when dropping files into the desktop

2020-01-21 Thread David Edmundson
davidedmundson accepted this revision.
davidedmundson added a comment.
This revision is now accepted and ready to land.


  Cool cool. I think there's potential to move more logic from 
ContainmentInterface into DropMenu object, but we can spread that task out.
  
  We actually have some crashers in this mime handling code, so I'm happy to 
see someone spending some time on it.
  
  (Somewhere in 
https://bugs.kde.org/buglist.cgi?bug_status=UNCONFIRMED_status=CONFIRMED_status=ASSIGNED_status=REOPENED_id=1705725=ContainmentInterface_type=allwordssubstr=frameworks-plasma=plasmashell_format=advanced)
 might be worth taking a look.

INLINE COMMENTS

> dropmenu.cpp:66
> +{
> +if (m_urls != urls) {
> +m_urls = urls;

This is slower than just assigning

REPOSITORY
  R242 Plasma Framework (Library)

BRANCH
  improve-file-drop-menu

REVISION DETAIL
  https://phabricator.kde.org/D26691

To: trmdi, #plasma, mart, broulik, #vdg, davidedmundson
Cc: davidedmundson, anthonyfieroni, #plasma, kde-frameworks-devel, LeGast00n, 
GB_2, michaelh, ngraham, bruns


D26691: Optimize code when dropping files into the desktop

2020-01-21 Thread Tranter Madi
trmdi marked 3 inline comments as done.
trmdi added inline comments.

INLINE COMMENTS

> davidedmundson wrote in containmentinterface.cpp:548
> can you be sure urls has at least 1 at this point?

Yes, because all `clearDataForMimeJob` are called from inside of 
`mimeTypeRetrieved` which is only called from here: 
https://phabricator.kde.org/source/plasma-framework/browse/master/src/scriptengines/qml/plasmoid/containmentinterface.cpp$454

REPOSITORY
  R242 Plasma Framework (Library)

REVISION DETAIL
  https://phabricator.kde.org/D26691

To: trmdi, #plasma, mart, broulik, #vdg, davidedmundson
Cc: davidedmundson, anthonyfieroni, #plasma, kde-frameworks-devel, LeGast00n, 
GB_2, michaelh, ngraham, bruns


D26691: Optimize code when dropping files into the desktop

2020-01-21 Thread Tranter Madi
trmdi updated this revision to Diff 74030.
trmdi added a comment.


  - Code style

REPOSITORY
  R242 Plasma Framework (Library)

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D26691?vs=74025=74030

BRANCH
  improve-file-drop-menu

REVISION DETAIL
  https://phabricator.kde.org/D26691

AFFECTED FILES
  src/scriptengines/qml/plasmoid/containmentinterface.cpp
  src/scriptengines/qml/plasmoid/containmentinterface.h
  src/scriptengines/qml/plasmoid/dropmenu.cpp
  src/scriptengines/qml/plasmoid/dropmenu.h

To: trmdi, #plasma, mart, broulik, #vdg, davidedmundson
Cc: davidedmundson, anthonyfieroni, #plasma, kde-frameworks-devel, LeGast00n, 
GB_2, michaelh, ngraham, bruns


D26691: Optimize code when dropping files into the desktop

2020-01-21 Thread Tranter Madi
trmdi updated this revision to Diff 74025.
trmdi added a comment.


  - Handle the case in which the menu is not shown

REPOSITORY
  R242 Plasma Framework (Library)

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D26691?vs=73815=74025

BRANCH
  improve-file-drop-menu

REVISION DETAIL
  https://phabricator.kde.org/D26691

AFFECTED FILES
  src/scriptengines/qml/plasmoid/containmentinterface.cpp
  src/scriptengines/qml/plasmoid/containmentinterface.h
  src/scriptengines/qml/plasmoid/dropmenu.cpp
  src/scriptengines/qml/plasmoid/dropmenu.h

To: trmdi, #plasma, mart, broulik, #vdg, davidedmundson
Cc: davidedmundson, anthonyfieroni, #plasma, kde-frameworks-devel, LeGast00n, 
GB_2, michaelh, ngraham, bruns


D26691: Optimize code when dropping files into the desktop

2020-01-20 Thread Tranter Madi
trmdi added inline comments.

INLINE COMMENTS

> davidedmundson wrote in dropmenu.cpp:48
> where does this menu get deleted? It seems to leak

It is set to be deleted on close, at line 43.

REPOSITORY
  R242 Plasma Framework (Library)

REVISION DETAIL
  https://phabricator.kde.org/D26691

To: trmdi, #plasma, mart, broulik, #vdg, davidedmundson
Cc: davidedmundson, anthonyfieroni, #plasma, kde-frameworks-devel, LeGast00n, 
GB_2, michaelh, ngraham, bruns


D26691: Optimize code when dropping files into the desktop

2020-01-20 Thread David Edmundson
davidedmundson added inline comments.

INLINE COMMENTS

> containmentinterface.cpp:548
> +
> +if (!m_dropMenu->urls().at(0).isLocalFile()) {
> +QApplication::restoreOverrideCursor();

can you be sure urls has at least 1 at this point?

> dropmenu.cpp:36
> +
> +DropMenu::DropMenu(KIO::DropJob *dropJob, QPoint dropPoint, 
> ContainmentInterface *parent)
> +: QObject(parent),

const QPoint 

> dropmenu.cpp:48
> +}
> +connect(m_menu, ::destroyed, this, ::deleteLater);
> +} else {

where does this menu get deleted? It seems to leak

REPOSITORY
  R242 Plasma Framework (Library)

REVISION DETAIL
  https://phabricator.kde.org/D26691

To: trmdi, #plasma, mart, broulik, #vdg, davidedmundson
Cc: davidedmundson, anthonyfieroni, #plasma, kde-frameworks-devel, LeGast00n, 
GB_2, michaelh, ngraham, bruns


D26691: Optimize code when dropping files into the desktop

2020-01-17 Thread Tranter Madi
trmdi updated this revision to Diff 73815.
trmdi added a comment.


  - Add DropMenu class to combine choices/dropjobMenu
  - Only 1 menu can be created
  - Fix some possible memory leaks

REPOSITORY
  R242 Plasma Framework (Library)

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D26691?vs=73716=73815

BRANCH
  improve-file-drop-menu

REVISION DETAIL
  https://phabricator.kde.org/D26691

AFFECTED FILES
  src/scriptengines/qml/plasmoid/containmentinterface.cpp
  src/scriptengines/qml/plasmoid/containmentinterface.h
  src/scriptengines/qml/plasmoid/dropmenu.cpp
  src/scriptengines/qml/plasmoid/dropmenu.h

To: trmdi, #plasma, mart, broulik, #vdg, davidedmundson
Cc: davidedmundson, anthonyfieroni, #plasma, kde-frameworks-devel, LeGast00n, 
GB_2, michaelh, ngraham, bruns


D26691: Optimize code when dropping files into the desktop

2020-01-16 Thread David Edmundson
davidedmundson requested changes to this revision.
davidedmundson added a comment.
This revision now requires changes to proceed.


  m_dropActions is conceptually linked to the menu we are showing
  It shouldn't a direct member variable of ContainmentInterface
  
  If we're following the existing pattern of this menu, it should be:
   QHash *> m_dropJobs;
  
  Otherwise you have no overlap protection on something that's async
  
  I also am very confident if you either subclassed DropJob or used lamba's we 
can get rid of all of these hashes and make this code 10 billion times more 
readable. 
  (we have some crashers here, so it would be well worth it)

REPOSITORY
  R242 Plasma Framework (Library)

REVISION DETAIL
  https://phabricator.kde.org/D26691

To: trmdi, #plasma, mart, broulik, #vdg, davidedmundson
Cc: davidedmundson, anthonyfieroni, #plasma, kde-frameworks-devel, LeGast00n, 
GB_2, michaelh, ngraham, bruns


D26691: Optimize code when dropping files into the desktop

2020-01-16 Thread Tranter Madi
trmdi updated this revision to Diff 73716.
trmdi added a comment.


  - Change the cursor to the busy state when the first file is not local

REPOSITORY
  R242 Plasma Framework (Library)

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D26691?vs=73694=73716

BRANCH
  improve-file-drop-menu

REVISION DETAIL
  https://phabricator.kde.org/D26691

AFFECTED FILES
  src/scriptengines/qml/plasmoid/containmentinterface.cpp
  src/scriptengines/qml/plasmoid/containmentinterface.h

To: trmdi, #plasma, mart, broulik, #vdg
Cc: anthonyfieroni, #plasma, kde-frameworks-devel, LeGast00n, GB_2, michaelh, 
ngraham, bruns


D26691: Optimize code when dropping files into the desktop

2020-01-16 Thread Tranter Madi
trmdi updated this revision to Diff 73694.
trmdi marked an inline comment as done.
trmdi added a comment.


  - Remove unneeded code

REPOSITORY
  R242 Plasma Framework (Library)

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D26691?vs=73693=73694

BRANCH
  improve-file-drop-menu

REVISION DETAIL
  https://phabricator.kde.org/D26691

AFFECTED FILES
  src/scriptengines/qml/plasmoid/containmentinterface.cpp
  src/scriptengines/qml/plasmoid/containmentinterface.h

To: trmdi, #plasma, mart, broulik, #vdg
Cc: anthonyfieroni, #plasma, kde-frameworks-devel, LeGast00n, GB_2, michaelh, 
ngraham, bruns


D26691: Optimize code when dropping files into the desktop

2020-01-16 Thread Tranter Madi
trmdi marked an inline comment as done.

REPOSITORY
  R242 Plasma Framework (Library)

REVISION DETAIL
  https://phabricator.kde.org/D26691

To: trmdi, #plasma, mart, broulik, #vdg
Cc: anthonyfieroni, #plasma, kde-frameworks-devel, LeGast00n, GB_2, michaelh, 
ngraham, bruns


D26691: Optimize code when dropping files into the desktop

2020-01-16 Thread Tranter Madi
trmdi updated this revision to Diff 73693.
trmdi added a comment.


  - Remove unneeded code

REPOSITORY
  R242 Plasma Framework (Library)

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D26691?vs=73634=73693

BRANCH
  improve-file-drop-menu

REVISION DETAIL
  https://phabricator.kde.org/D26691

AFFECTED FILES
  src/scriptengines/qml/plasmoid/containmentinterface.cpp
  src/scriptengines/qml/plasmoid/containmentinterface.h

To: trmdi, #plasma, mart, broulik, #vdg
Cc: anthonyfieroni, #plasma, kde-frameworks-devel, LeGast00n, GB_2, michaelh, 
ngraham, bruns


D26691: Optimize code when dropping files into the desktop

2020-01-16 Thread Tranter Madi
trmdi added reviewers: broulik, VDG.

REPOSITORY
  R242 Plasma Framework (Library)

REVISION DETAIL
  https://phabricator.kde.org/D26691

To: trmdi, #plasma, mart, broulik, #vdg
Cc: anthonyfieroni, #plasma, kde-frameworks-devel, LeGast00n, GB_2, michaelh, 
ngraham, bruns


D26691: Optimize code when dropping files into the desktop

2020-01-16 Thread Anthony Fieroni
anthonyfieroni added inline comments.

INLINE COMMENTS

> containmentinterface.cpp:589
> +}
> +qDebug() << "clearDataForMimeJob() ends.";
>  }

Don't add uncategorized qDebug, i see it exists in code base but they should be 
ported as well.

> containmentinterface.cpp:816-819
> +//choices->exec();
>  } else {
> -dropJob->setApplicationActions(dropActions);
> +//dropJob->setApplicationActions(m_dropActions);
>  }

Remove, don't leave commented code

REPOSITORY
  R242 Plasma Framework (Library)

REVISION DETAIL
  https://phabricator.kde.org/D26691

To: trmdi, #plasma, mart
Cc: anthonyfieroni, #plasma, kde-frameworks-devel, LeGast00n, GB_2, michaelh, 
ngraham, bruns


D26691: Optimize code when dropping files into the desktop

2020-01-15 Thread Tranter Madi
trmdi edited the summary of this revision.

REPOSITORY
  R242 Plasma Framework (Library)

REVISION DETAIL
  https://phabricator.kde.org/D26691

To: trmdi, #plasma, mart
Cc: #plasma, kde-frameworks-devel, LeGast00n, GB_2, michaelh, ngraham, bruns


D26691: Optimize code when dropping files into the desktop

2020-01-15 Thread Tranter Madi
trmdi edited the summary of this revision.

REPOSITORY
  R242 Plasma Framework (Library)

REVISION DETAIL
  https://phabricator.kde.org/D26691

To: trmdi, #plasma, mart
Cc: #plasma, kde-frameworks-devel, LeGast00n, GB_2, michaelh, ngraham, bruns


D26691: Optimize code when dropping files into the desktop

2020-01-15 Thread Tranter Madi
trmdi edited the summary of this revision.

REPOSITORY
  R242 Plasma Framework (Library)

REVISION DETAIL
  https://phabricator.kde.org/D26691

To: trmdi, #plasma, mart
Cc: #plasma, kde-frameworks-devel, LeGast00n, GB_2, michaelh, ngraham, bruns


D26691: Optimize code when dropping files into the desktop

2020-01-15 Thread Tranter Madi
trmdi retitled this revision from "[WIP] Optimize code when dropping files into 
the desktop" to "Optimize code when dropping files into the desktop".

REPOSITORY
  R242 Plasma Framework (Library)

REVISION DETAIL
  https://phabricator.kde.org/D26691

To: trmdi, #plasma, mart
Cc: #plasma, kde-frameworks-devel, LeGast00n, GB_2, michaelh, ngraham, bruns