Fixing QNetworkAccessManager use

Albert Astals Cid aacid at kde.org
Wed Feb 19 23:07:40 GMT 2020


El dimecres, 19 de febrer de 2020, a les 14:30:35 CET, Boudewijn Rempt va escriure:
> On woensdag 19 februari 2020 14:09:06 CET Friedrich W. H. Kossebau wrote:
> > Am Mittwoch, 19. Februar 2020, 08:05:01 CET schrieb Ben Cooksley:
> > > On Mon, Feb 3, 2020 at 7:42 AM Volker Krause <vkrause at kde.org> wrote:
> > > > It would also help to know where specifically we have that problem, so we
> > > > can actually solve it, and so we can figure out why we failed to fix this
> > > > there earlier.
> > > 
> > > Just bringing this up again - it seems we've not had much movement on
> > > this aside from the Wiki page.
> > 
> > The wiki page currently still just recommends to set
> > "networkAccessManger->setAttribute(QNetworkRequest::FollowRedirectsAttribute, 
> > true);"
> > 
> 
> 
> Which confuses me a bit, because that doesn't build? 
> 
> [ 44%] Building CXX object libs/ui/CMakeFiles/kritaui.dir/KisNetworkAccessManager.cpp.o
> /home/boud/dev/krita/libs/ui/KisNetworkAccessManager.cpp: In constructor ‘KisNetworkAccessManager::KisNetworkAccessManager(QObject*)’:
> /home/boud/dev/krita/libs/ui/KisNetworkAccessManager.cpp:30:5: error: ‘setAttribute’ was not declared in this scope
>      setAttribute(QNetworkRequest::NoLessSafeRedirectPolicy, true);
>      ^~~~~~~~~~~~
> /home/boud/dev/krita/libs/ui/KisNetworkAccessManager.cpp:30:5: note: suggested alternative: ‘setstate’
>      setAttribute(QNetworkRequest::NoLessSafeRedirectPolicy, true);
>      ^~~~~~~~~~~~
> 
> Shouldn't it be setRedirectPolicy(QNetworkRequest::NoLessSafeRedirectPolicy);

Correct, there's no setAttribute in QNAM.

Cheers,
  Albert

> 
> 








More information about the kde-core-devel mailing list