--===============9004666040479939909== Content-Type: multipart/alternative; boundary="===============9147369618420013051==" --===============9147369618420013051== 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/102290/#review8607 ----------------------------------------------------------- Ship it! there is an issue with the threading implementation, but this is easier to = fix than to explain and the fix will serve as a good explanation itself ;) = so commit what you have so far and i'll fix it and then you can look at the= changes to see how it was done. cheers ... editors/imageviewer/imageviewer.cpp the way to fix this is to render it from resizeEvent and tell the threa= d what size to make it. it's easier to show than to explain, so if you comm= it this patch, then i'll make the necessary changes and you can look and se= e how it was done. editors/imageviewer/imageviewer.cpp these become unecessary when the size of the image is the size of the w= idget :) mainwindow.cpp unecessary; just have the thread scale the image. - Aaron J. Seigo On Nov. 29, 2011, 4:42 p.m., Giorgos Tsiapaliwkas wrote: > = > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > http://git.reviewboard.kde.org/r/102290/ > ----------------------------------------------------------- > = > (Updated Nov. 29, 2011, 4:42 p.m.) > = > = > Review request for Plasma and Aaron J. Seigo. > = > = > Description > ------- > = > hello, > = > without this patch a user cannot add an image with plasmate. > = > reproduce,go to files-images-new,the plasmate will open a text editor ins= tead of a dialog,which(the dialog) is able to open an image. > = > With the patch a dialog will open asking for an image. > = > = > Diffs > ----- > = > CMakeLists.txt e825271 = > editors/CMakeLists.txt 1feb1ce = > editors/editpage.h 7b5dca3 = > editors/editpage.cpp d4b0082 = > editors/imageviewer/imageloader.h e69de29 = > editors/imageviewer/imageloader.cpp e69de29 = > editors/imageviewer/imageviewer.h e69de29 = > editors/imageviewer/imageviewer.cpp e69de29 = > main.cpp 66a7cd8 = > mainwindow.h 7d89815 = > mainwindow.cpp 6ea7f0c = > packagemodel.cpp 8c0907a = > = > Diff: http://git.reviewboard.kde.org/r/102290/diff/diff > = > = > Testing > ------- > = > the patch is not ready yet,i have noted some questions. > Also the plasmate tries to open the image with a text editor.This have to= be fixed,but how?Should we make plasmate able to preview images? > = > In addition,when you add something in the list of files(using the differe= nt options provided by the files qdockwidget) it names it as "new".This has= to be fixed and the plasmate has to show the real name of the file.(differ= ent request,i just want an approval for this patch). > = > = > Thanks, > = > Giorgos Tsiapaliwkas > = > --===============9147369618420013051== 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/102290/

Ship it!

there is a=
n issue with the threading implementation, but this is easier to fix than t=
o explain and the fix will serve as a good explanation itself ;) so commit =
what you have so far and i'll fix it and then you can look at the chang=
es to see how it was done. cheers ...

= =
editors/imageviewer/imageviewer.cpp (Diff revision 6)
ImageViewer::ImageViewer(const KUrl& image,QWidget* parent)
47
    loadImage(m_image);
48
}
49
50
void ImageViewer::loadImage=
(const KUrl& image)
51
{
52
    if(image.path().endsWith=
(".svg"<=
span class=3D"p">) || ima=
ge.path().endsWith(".svgz")) {
53
        loadSvg(image);
54
    } else {
55
        m_loader =3D new Ima=
geLoader(image, this);
56
        connect(m_loader, SIGNAL(loadImage(QImage)), this, SLOT(loadPixmap(=
QImage)));
57
        QThreadPool::globalInstance()->start(m_loader);
58
    }
59
}
the way to fix this is to render it from resizeEvent and tell the th=
read what size to make it. it's easier to show than to explain, so if y=
ou commit this patch, then i'll make the necessary changes and you can =
look and see how it was done.

= =
editors/imageviewer/imageviewer.cpp (Diff revision 6)
ImageViewer::ImageViewer(const KUrl& image,QWidget* parent)
74
const QSize ImageViewer::imageSize()
75
{
76
    return m_size;
77
}
78
79
void ImageViewer::setImageS=
ize(const QSize& size=
)
80
{/=
/TODO because the non s=
vg images are being threaded the
81
//QSize becomes invalid.
82
    m_size =3D size;<=
/pre>
83
}
these become unecessary when the size of the image is the size of th=
e widget :)

= =
mainwindow.cpp (Diff revision 6)
void MainWindow::loadImageViewer(const KUrl& target)
631
632
    if (m_imageViewer->imageSize().height() < m_imageViewer-><=
span class=3D"n">size().h=
eight() &&=
633
        m_imageViewer=
->imageSize().width() =
< m_imageViewer->size().width()) {
634
        m_central->switchTo(m_imageViewer);=
635
    } else {
636
        KMessageBox::information(this, "Your image is bigger than your screen and it will not be r=
endered");
637
    }
unecessary; just have the thread scale the image.

- Aaron J.


On November 29th, 2011, 4:42 p.m., Giorgos Tsiapaliwkas wrote:

Review request for Plasma and Aaron J. Seigo.
By Giorgos Tsiapaliwkas.

Updated Nov. 29, 2011, 4:42 p.m.

Descripti= on

hello,

without this patch a user cannot add an image with plasmate.

reproduce,go to files-images-new,the plasmate will open a text editor inste=
ad of a dialog,which(the dialog) is able to open an image.

With the patch a dialog will open asking for an image.

Testing <= /h1>
the patch is not ready yet,i have noted some questions.
Also the plasmate tries to open the image with a text editor.This have to b=
e fixed,but how?Should we make plasmate able to preview images?

In addition,when you add something in the list of files(using the different=
 options provided by the files qdockwidget) it names it as "new".=
This has to be fixed and the plasmate has to show the real name of the file=
.(different request,i just want an approval for this patch).

Diffs=

  • CMakeLists.txt (e825271)
  • editors/CMakeLists.txt (1feb1ce)
  • editors/editpage.h (7b5dca3)
  • editors/editpage.cpp (d4b0082)
  • editors/imageviewer/imageloader.h (e69de29= )
  • editors/imageviewer/imageloader.cpp (e69de= 29)
  • editors/imageviewer/imageviewer.h (e69de29= )
  • editors/imageviewer/imageviewer.cpp (e69de= 29)
  • main.cpp (66a7cd8)
  • mainwindow.h (7d89815)
  • mainwindow.cpp (6ea7f0c)
  • packagemodel.cpp (8c0907a)

View Diff

--===============9147369618420013051==-- --===============9004666040479939909== 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 --===============9004666040479939909==--