From kde-core-devel Wed Aug 22 20:37:15 2012 From: "Albert Astals Cid" Date: Wed, 22 Aug 2012 20:37:15 +0000 To: kde-core-devel Subject: Re: Review Request: Add urlChanged signal to ReadOnlyPart Message-Id: <20120822203715.29386.90173 () vidsolbach ! de> X-MARC-Message: https://marc.info/?l=kde-core-devel&m=134566785410827 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--===============1130201502282143170==" --===============1130201502282143170== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable > On Aug. 22, 2012, 11:18 a.m., David Faure wrote: > > kparts/part.cpp, line 996 > > > > > > If it didn't change, why emit urlChanged() here? > > i.e. I think this line should be kept as m_url =3D m_originalURL. This is executed in _k_slotUploadFinished that is called from the saveAs ca= se when it's a network file, as you see saveAs does d->m_url =3D kurl; // Store where to upload in saveToURL d->prepareSaving(); bool result =3D save(); // Save local file and upload local file if (result) { emit urlChanged( d->m_url ); emit setWindowCaption( d->m_url.prettyUrl() ); } else { But save in the network case just starts the job, so if the job fails i nee= d to reemit urlChanged with the "old" url. Makes sense? - Albert ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: http://git.reviewboard.kde.org/r/106116/#review17858 ----------------------------------------------------------- On Aug. 21, 2012, 8:35 p.m., Albert Astals Cid wrote: > = > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > http://git.reviewboard.kde.org/r/106116/ > ----------------------------------------------------------- > = > (Updated Aug. 21, 2012, 8:35 p.m.) > = > = > Review request for kdelibs and David Faure. > = > = > Description > ------- > = > Add this signal since i found i needed it in Okular, we've solved the pro= blem in a different way, but maybe the next person that needs the signal ha= s it available :-) > = > I don't care to which branch to add it. > = > = > Diffs > ----- > = > kparts/part.h 56b64da = > kparts/part.cpp f74bd78 = > = > Diff: http://git.reviewboard.kde.org/r/106116/diff/ > = > = > Testing > ------- > = > None > = > = > Thanks, > = > Albert Astals Cid > = > --===============1130201502282143170== 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/106116/

On August 22nd, 2012, 11:18 a.m., David Fau= re wrote:

= = =
kparts/part.cpp (Diff revision 2)
void ReadWritePartPrivate::_k_slotUploadFinished( KJob * )
994
            m_url =3D m_=
originalURL;
996
            q-><=
span class=3D"n">setUrl<=
span class=3D"hl">(m_originalURL);
If it did=
n't change, why emit urlChanged() here?
i.e. I think this line should be kept as m_url =3D m_originalURL.
This is executed in _k_slotUploadFinished that is called from the sa=
veAs case when it's a network file, as you see saveAs does
    d->m_url =3D kurl; // Store where to upload in saveToURL
    d->prepareSaving();
    bool result =3D save(); // Save local file and upload local file
    if (result) {
        emit urlChanged( d->m_url );
        emit setWindowCaption( d->m_url.prettyUrl() );
    } else {

But save in the network case just starts the job, so if the job fails i nee=
d to reemit urlChanged with the "old" url.

Makes sense?

- Albert


On August 21st, 2012, 8:35 p.m., Albert Astals Cid wrote:

Review request for kdelibs and David Faure.
By Albert Astals Cid.

Updated Aug. 21, 2012, 8:35 p.m.

Descripti= on

Add this signal since i found i needed it in Okular, we'=
ve solved the problem in a different way, but maybe the next person that ne=
eds the signal has it available :-)

I don't care to which branch to add it.

Testing <= /h1>
None

Diffs=

  • kparts/part.h (56b64da)
  • kparts/part.cpp (f74bd78)

View Diff

--===============1130201502282143170==--