From kde-panel-devel Mon Jun 20 10:01:19 2011 From: "Aaron J. Seigo" Date: Mon, 20 Jun 2011 10:01:19 +0000 To: kde-panel-devel Subject: Re: Review Request: Changes at the functionality of the delete button. Message-Id: <20110620100119.23833.28771 () vidsolbach ! de> X-MARC-Message: https://marc.info/?l=kde-panel-devel&m=130856411009376 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--===============0358191770==" --===============0358191770== Content-Type: multipart/alternative; boundary="===============2068319808696741535==" --===============2068319808696741535== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: http://git.reviewboard.kde.org/r/101535/#review4042 ----------------------------------------------------------- projectmanager/projectmanager.cpp this is buggy. if confirmRemoveFromDisk is called first and then later = confirmRemoveFromList is called ... m_destroyFlag will still be true and th= e project will not just be removed from the list, but also disk! = instead, i recommend changing removeProcess to take a bool and change t= he name to something more accurate about the method's job, e.g.: removeProj= ect(bool deleteFiles). then call it directly from both places, so in confir= mRemoveFromList we'd get: = if (KMessageBox::warningContinueCancel(this, dialogText) =3D=3D KMessag= eBox::Continue) { removeProject(false); } = and in confirmRemoveFromDisk: = if (KMessageBox::warningContinueCancel(this, dialogText) =3D=3D KMessag= eBox::Continue) { removeProject(true); } = - Aaron J. On June 10, 2011, 9 p.m., Giorgos Tsiapaliwkas wrote: > = > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > http://git.reviewboard.kde.org/r/101535/ > ----------------------------------------------------------- > = > (Updated June 10, 2011, 9 p.m.) > = > = > Review request for Plasma. > = > = > Summary > ------- > = > Hello, > = > after a discussion with Aaron Seigo at the #plasma we decided to add a ne= w button at the project manager which is named "Remove Project From List",w= hich deletes the project only from the list(not from disk).The delete butto= n was renamed to "Remove Project From Disk".Also i consider it properly to = change the names of some function in order to be more relative with the but= tons names.As well i changed and the functionality of confirmdeletion() in = order to avoid using the same code twice. > = > = > Diffs > ----- > = > projectmanager/projectmanager.h 2c5bff2 = > projectmanager/projectmanager.cpp c00fd27 = > = > Diff: http://git.reviewboard.kde.org/r/101535/diff > = > = > Testing > ------- > = > compiles and runs without regressions. > tested by me. > = > = > Thanks, > = > Giorgos > = > --===============2068319808696741535== Content-Type: text/html; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable
This is an automatically generated e-mail. To reply, visit: http://git.revie= wboard.kde.org/r/101535/

= = = = = = = = = =
projectmanager/projectmanager.cpp (Diff revision 4)
void ProjectManager::confirmDeletion()
61
void ProjectManager::confir=
mDeletion()
=
65
void ProjectManager::confir=
mRemoveFromList()=
62
{
66
{
63
    //TODO: might want to disallow deleting a curr=
ently active project, or handle it
67
    //TODO: might want to disallow deleting a curr=
ently active project, or handle it
64
    //      gracefully some=
how.
68
    //      gracefully some=
how.
65
    QString dialogText =3D i=
18n("Are you sure yo=
u want to delete the selected projects? This cann=
ot be undone.");
69
    QString dialogText =3D i=
18n("Are you sure yo=
u want to remove the selected projects from the list? This cannot be undone.");
66
    int code =3D KMessageB=
ox::warningContinueCancel=
(this, dialogText);
70
    int code =3D KMessageB=
ox::warningContinueCancel=
(this, dialogText);
67
    if (code !=3D KMessageBox::Continue) return;
71
    if (code !=3D KMessageBox::Continue) return;
72
   removeProcess();
73
}
this is buggy. if confirmRemoveFromDisk is called first and then lat=
er confirmRemoveFromList is called ... m_destroyFlag will still be true and=
 the project will not just be removed from the list, but also disk!

instead, i recommend changing removeProcess to take a bool and change the n=
ame to something more accurate about the method's job, e.g.: removeProj=
ect(bool deleteFiles). then call it directly from both places, so in confir=
mRemoveFromList we'd get:

if (KMessageBox::warningContinueCancel(this, dialogText) =3D=3D KMessageBox=
::Continue) {
    removeProject(false);
}

and in confirmRemoveFromDisk:

if (KMessageBox::warningContinueCancel(this, dialogText) =3D=3D KMessageBox=
::Continue) {
    removeProject(true);
}

- Aaron J.


On June 10th, 2011, 9 p.m., Giorgos Tsiapaliwkas wrote:

Review request for Plasma.
By Giorgos Tsiapaliwkas.

Updated June 10, 2011, 9 p.m.

Descripti= on

Hello,

after a discussion with Aaron Seigo at the #plasma we decided to add a new =
button at the project manager which is named "Remove Project From List=
",which deletes the project only from the list(not from disk).The dele=
te button was renamed to "Remove Project From Disk".Also i consid=
er it properly to change the names of some function in order to be more rel=
ative with the buttons names.As well i changed and the functionality of con=
firmdeletion() in order to avoid using the same code twice.

Testing <= /h1>
compiles and runs without regressions.
tested by me.

Diffs=

  • projectmanager/projectmanager.h (2c5bff2)<= /span>
  • projectmanager/projectmanager.cpp (c00fd27= )

View Diff

--===============2068319808696741535==-- --===============0358191770== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Plasma-devel mailing list Plasma-devel@kde.org https://mail.kde.org/mailman/listinfo/plasma-devel --===============0358191770==--