summaryrefslogtreecommitdiff
authoralwin <alwin>2005-04-14 23:15:05 (UTC)
committer alwin <alwin>2005-04-14 23:15:05 (UTC)
commit4bf8d42034beee5e28b25182e21cf74f3c2da6a8 (patch) (unidiff)
tree8b882f872f9ddea939722242c229eea46545274b
parent5fd266a3a5a6d9a1acb9c38e4802ff06ba38beaf (diff)
downloadopie-4bf8d42034beee5e28b25182e21cf74f3c2da6a8.zip
opie-4bf8d42034beee5e28b25182e21cf74f3c2da6a8.tar.gz
opie-4bf8d42034beee5e28b25182e21cf74f3c2da6a8.tar.bz2
small fix
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer3/playlist.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/noncore/multimedia/opieplayer3/playlist.cpp b/noncore/multimedia/opieplayer3/playlist.cpp
index 6f2e668..fe2dde3 100644
--- a/noncore/multimedia/opieplayer3/playlist.cpp
+++ b/noncore/multimedia/opieplayer3/playlist.cpp
@@ -142,49 +142,53 @@ void PlaylistView::addFile(const QString&aFile,const QString&aName)
142 i = m_Infolib->error(); 142 i = m_Infolib->error();
143 odebug << "Errorcode: " << i << oendl; 143 odebug << "Errorcode: " << i << oendl;
144 QString msg; 144 QString msg;
145 msg = QString(tr("Error open file %1: ")).arg(name); 145 msg = QString(tr("Error open file %1: ")).arg(name);
146 switch (i) { 146 switch (i) {
147 case 1: 147 case 1:
148 msg += tr("No input plugin"); 148 msg += tr("No input plugin");
149 break; 149 break;
150 case 2: 150 case 2:
151 msg += tr("No demuxer plugin"); 151 msg += tr("No demuxer plugin");
152 break; 152 break;
153 case 3: 153 case 3:
154 msg += tr("Demuxer failed"); 154 msg += tr("Demuxer failed");
155 break; 155 break;
156 case 4: 156 case 4:
157 msg+=tr("Malformed mrl"); 157 msg+=tr("Malformed mrl");
158 break; 158 break;
159 default: 159 default:
160 msg += tr("Unknown error"); 160 msg += tr("Unknown error");
161 break; 161 break;
162 } 162 }
163 QMessageBox::warning(0,tr("Error reading fileheader"),msg); 163 QMessageBox::warning(0,tr("Error reading fileheader"),msg);
164 return; 164 return;
165 } 165 }
166 m_lastItem = m_items.last(); 166 if (m_items.count()>0) {
167 m_lastItem = m_items.last();
168 } else {
169 m_lastItem = 0;
170 }
167 PlaylistItem*_it = currentItem(); 171 PlaylistItem*_it = currentItem();
168 172
169 if (m_lastItem) { 173 if (m_lastItem) {
170 m_lastItem = new PlaylistItem(aFile,this,m_lastItem); 174 m_lastItem = new PlaylistItem(aFile,this,m_lastItem);
171 } else { 175 } else {
172 m_lastItem = new PlaylistItem(aFile,this); 176 m_lastItem = new PlaylistItem(aFile,this);
173 } 177 }
174 m_lastItem->setExpandable(false); 178 m_lastItem->setExpandable(false);
175 m_lastItem->setText(1,name); 179 m_lastItem->setText(1,name);
176 180
177 QString codec = m_Infolib->metaInfo(6); 181 QString codec = m_Infolib->metaInfo(6);
178 if (codec.isEmpty()) { 182 if (codec.isEmpty()) {
179 codec = m_Infolib->metaInfo(7); 183 codec = m_Infolib->metaInfo(7);
180 } 184 }
181 // codec 185 // codec
182 m_lastItem->setText(COL_TYPE,codec); 186 m_lastItem->setText(COL_TYPE,codec);
183 // title 187 // title
184 m_lastItem->setText(COL_TITLE,m_Infolib->metaInfo(0)); 188 m_lastItem->setText(COL_TITLE,m_Infolib->metaInfo(0));
185 // artist 189 // artist
186 m_lastItem->setText(COL_ARTIST,m_Infolib->metaInfo(2)); 190 m_lastItem->setText(COL_ARTIST,m_Infolib->metaInfo(2));
187 // album 191 // album
188 m_lastItem->setText(COL_ALBUM,m_Infolib->metaInfo(4)); 192 m_lastItem->setText(COL_ALBUM,m_Infolib->metaInfo(4));
189 int l = m_Infolib->length(); 193 int l = m_Infolib->length();
190 int h = l/3600; 194 int h = l/3600;