Changeset 17 for lib/mpdconnection.cpp
- Timestamp:
- 12/30/07 20:55:36 (4 years ago)
- File:
-
- 1 edited
-
lib/mpdconnection.cpp (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lib/mpdconnection.cpp
r11 r17 17 17 } 18 18 19 /*MPDConnection::~MPDConnection() 20 { 21 qDebug("Closing MPDConnection..."); 22 }*/ 19 MPDConnection::~MPDConnection() 20 { 21 sock.disconnectFromHost(); 22 quit(); 23 24 while(isRunning()) 25 msleep(100); 26 } 23 27 24 28 void MPDConnection::run() … … 69 73 70 74 if(hostname.isEmpty() || port == 0) { 71 q Debug("MPDConnection: no hostname and/or port supplied.");75 qWarning("MPDConnection: no hostname and/or port supplied."); 72 76 return false; 73 77 } … … 104 108 return true; 105 109 } else { 106 q Debug("Couldn't connect");110 qWarning("Couldn't connect"); 107 111 return false; 108 112 } … … 152 156 */ 153 157 158 void MPDConnection::listAllInfo() 159 { 160 QByteArray *data; 161 162 sendCommand("listallinfo"); 163 data = readFromSocket(); 164 165 emit musicLibraryUpdated(MPDParseUtils::parseLibraryItems(data)); 166 167 delete data; 168 } 169 170 void MPDConnection::lsInfo() 171 { 172 QByteArray *data; 173 174 sendCommand("lsinfo"); 175 data = readFromSocket(); 176 177 emit musicLibraryUpdated(MPDParseUtils::parseLibraryItems(data)); 178 179 delete data; 180 } 181 182 154 183 /* 155 184 * Playlist commands … … 369 398 { 370 399 QByteArray *data; 400 MPDStatus status; 371 401 372 402 sendCommand("status"); 373 403 data = readFromSocket(); 374 375 emit statusUpdated(MPDParseUtils::parseStatus(data)); 404 MPDParseUtils::parseStatus(data, status); 405 406 emit statusUpdated(status); 376 407 377 408 delete data;
Note: See TracChangeset
for help on using the changeset viewer.
