Get url list

Aaron J. Seigo aseigo at kde.org
Wed May 13 09:28:38 CEST 2009


On Wednesday 13 May 2009, SUJITH H wrote:
> Aaron J. Seigo wrote:
> > On Tuesday 12 May 2009, SUJITH H wrote:
> >> I am able to iterate the row's. But have no clue how to retrieve the url
> >> of that sorted Favorite item :(
> >
> > KUrl url = childData->data(Kickoff::UrlRole);
>
> I am getting segmentation fault when I run 'plasmoidviewer launcher'.
> I had modified the sortFavorites. So the method becomes:
>
> void FavoritesModel::sortFavorites(Qt::SortOrder order)
> {
>     foreach (FavoritesModel *model, Private::models) {
>         model->d->headerItem->sortChildren(0, order);
>     }
>     FavoritesModel *model;
>     QStandardItem *childData;
>     for (int i = 0; i < numberOfFavorites(); i++) {
>          childData = model->d->headerItem->child(i, 0);
>          kDebug() << "Url = " << childData->data(Kickoff::UrlRole);
>     }
>     Private::saveFavorites();
> }
>
>
> Any clue why am getting segmentation fault here?

model isn't initialized, so it's point to some random place in memory and 
*crash*

FavoritesModel *model = Private::models.first();

-- 
Aaron J. Seigo
humru othro a kohnu se
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43

KDE core developer sponsored by Qt Software

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/plasma-devel/attachments/20090513/43bb201f/attachment.sig 


More information about the Plasma-devel mailing list