NewPoi::NewPoi(Poi *APoi, IMapLocationSelector *AMapLocationSelector, QList<IAccount *> &AAccounts, const QString &ATitle, const GeolocElement &APoiData, QWidget *parent) : QDialog(parent), ui(new Ui::NewPoi), FPoi(APoi), FMapLocationSelector(AMapLocationSelector), FAccounts(&AAccounts), FCountryIconStorage(IconStorage::staticStorage(RSR_STORAGE_COUNTRY)), FLocationSelect(false), FExtendedView(true), FCountryCodeSet(false), FSchemes(QStringList() << "http" << "https" << "ftp" << "xmpp" << "mailto" << "tel" << "native") { ui->setupUi(this); setWindowTitle(ATitle); setWindowIcon(APoi->getIcon(MNI_POI_ADD)); init(); if (!APoiData.isEmpty()) setEditPoi(APoiData); onMoreClicked(); if (FMapLocationSelector) connect(ui->selectLocation, SIGNAL(clicked()), SLOT(onSelectLocationClicked())); else ui->selectLocation->hide(); }
void ScrobblesListWidget::read() { qDebug() << m_path; clear(); // always have a now playing item in the list m_trackItem = new ScrobblesListWidgetItem( this ); TrackWidget* trackWidget = new TrackWidget( m_track, this ); trackWidget->setObjectName( "nowPlaying" ); setItemWidget( m_trackItem, trackWidget ); m_trackItem->setSizeHint( trackWidget->sizeHint() ); m_trackItem->setHidden( true ); m_trackItem->setNowPlaying( true ); connect( trackWidget, SIGNAL(clicked(TrackWidget&)), SLOT(onItemClicked(TrackWidget&)) ); // always have the refresh button in the list m_refreshItem = new ScrobblesListWidgetItem( this ); RefreshButton* refreshButton = new RefreshButton( this ); refreshButton->setObjectName( "refresh" ); setItemWidget( m_refreshItem, refreshButton ); m_refreshItem->setSizeHint( refreshButton->sizeHint() ); connect( refreshButton, SIGNAL(clicked()), SLOT(refresh()) ); onRefreshing( false ); // always have a view more item in the list m_moreItem = new ScrobblesListWidgetItem( this ); QPushButton* moreButton = new QPushButton( tr( "More Scrobbles at Last.fm" ), this ); moreButton->setObjectName( "more" ); setItemWidget( m_moreItem, moreButton ); m_moreItem->setSizeHint( moreButton->sizeHint() ); connect( moreButton, SIGNAL(clicked()), SLOT(onMoreClicked()) ); QFile file( m_path ); file.open( QFile::Text | QFile::ReadOnly ); QTextStream stream( &file ); stream.setCodec( "UTF-8" ); QDomDocument xml; xml.setContent( stream.readAll() ); QList<Track> tracks; for (QDomNode n = xml.documentElement().lastChild(); !n.isNull(); n = n.previousSibling()) tracks << Track( n.toElement() ); addTracks( tracks ); fetchTrackInfo( tracks ); limit( kScrobbleLimit ); }