[Kpod-devel] libqtpod/src ipod.cpp,1.1,1.2 itunesdb.cpp,1.2,1.3 itunesdb.h,1.1,1.2 src.pro,1.6,1.7
Status: Beta
Brought to you by:
fry26
From: Michael S. <fr...@us...> - 2006-03-04 15:56:38
|
Update of /cvsroot/kpod/libqtpod/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32336/src Modified Files: ipod.cpp itunesdb.cpp itunesdb.h src.pro Log Message: some more cleanups Index: itunesdb.h =================================================================== RCS file: /cvsroot/kpod/libqtpod/src/itunesdb.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** itunesdb.h 2 Mar 2006 23:54:12 -0000 1.1 --- itunesdb.h 4 Mar 2006 15:56:31 -0000 1.2 *************** *** 92,96 **** QString error; ! ITunesDB(); virtual ~ITunesDB(); --- 92,96 ---- QString error; ! ITunesDB( const QString& ipod_base ); virtual ~ITunesDB(); *************** *** 99,103 **** * @return true if the itunesdb does exist and could be opened. For parse errors check the error member afterwards */ ! bool open(const QString& ipod_base); /** --- 99,103 ---- * @return true if the itunesdb does exist and could be opened. For parse errors check the error member afterwards */ ! bool open(); /** *************** *** 305,309 **** private: void removeFromAllPlaylists( Q_UINT32 trackid ); ! QFile itunesdbfile; QFile itunessdfile; --- 305,309 ---- private: void removeFromAllPlaylists( Q_UINT32 trackid ); ! QString m_itunesDir; QFile itunesdbfile; QFile itunessdfile; Index: itunesdb.cpp =================================================================== RCS file: /cvsroot/kpod/libqtpod/src/itunesdb.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** itunesdb.cpp 4 Mar 2006 14:40:27 -0000 1.2 --- itunesdb.cpp 4 Mar 2006 15:56:31 -0000 1.3 *************** *** 120,133 **** using namespace itunesdb; - ITunesDB::ITunesDB() : - playlists( new PlaylistContainer() ), - maxtrackid(0), - maxTrackDBID(0), - hasPodcastsFlag( false ), - locked( false ) - { - playlists->setAutoDelete(true); - } - class ITunesDB::ItunesDBReaderAdapter : public itunesdb::ItunesDBListener { struct PlayCountEntry { --- 120,123 ---- *************** *** 369,381 **** }; ! bool ITunesDB::open(const QString& ipod_base) { // TODO remove trailing slash from ipod_base if there is one error= QString::null; ItunesDBReaderAdapter listener( *this, mainlist ); ItunesDBParser parser( listener ); - itunesdbfile.setName(ipod_base + "/iPod_Control/iTunes/iTunesDB"); - itunessdfile.setName(ipod_base + "/iPod_Control/iTunes/iTunesSD"); if(itunesdbfile.exists()) { timestamp = QFileInfo(itunesdbfile).lastModified(); --- 359,393 ---- }; ! /*** ITUNESDB methods ***/ ! ! ITunesDB::ITunesDB( const QString& ipod_base ) : ! playlists( new PlaylistContainer() ), ! maxtrackid(0), ! maxTrackDBID(0), ! m_itunesDir( ipod_base + "/iPod_Control/iTunes/" ), ! hasPodcastsFlag( false ), ! locked( false ) ! { ! playlists->setAutoDelete(true); ! } ! ! ! ITunesDB::~ITunesDB() ! { ! clear(); ! delete playlists; ! } ! ! ! bool ITunesDB::open() { // TODO remove trailing slash from ipod_base if there is one error= QString::null; + itunesdbfile.setName(m_itunesDir + "iTunesDB"); + itunessdfile.setName(m_itunesDir + "iTunesSD"); + ItunesDBReaderAdapter listener( *this, mainlist ); ItunesDBParser parser( listener ); if(itunesdbfile.exists()) { timestamp = QFileInfo(itunesdbfile).lastModified(); *************** *** 404,408 **** } ! QDir dir(ipod_base + "/iPod_Control/iTunes/"); dir.setNameFilter( "OTGPlaylistInfo*" ); for ( unsigned int i = 0; i < dir.count(); i++ ) { --- 416,420 ---- } ! QDir dir( m_itunesDir ); dir.setNameFilter( "OTGPlaylistInfo*" ); for ( unsigned int i = 0; i < dir.count(); i++ ) { *************** *** 413,417 **** } ! QFile myfile ( ipod_base + "/iPod_Control/iTunes/Play Counts" ); if (myfile.exists()) { parser.parsePlaycount( myfile ); --- 425,429 ---- } ! QFile myfile ( m_itunesDir + "Play Counts" ); if (myfile.exists()) { parser.parsePlaycount( myfile ); *************** *** 497,506 **** } - ITunesDB::~ITunesDB() - { - clear(); - delete playlists; - } - /************************************************* --- 509,512 ---- Index: src.pro =================================================================== RCS file: /cvsroot/kpod/libqtpod/src/src.pro,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** src.pro 3 Mar 2006 20:29:16 -0000 1.6 --- src.pro 4 Mar 2006 15:56:31 -0000 1.7 *************** *** 10,13 **** --- 10,19 ---- libqtpodincludes.files += *.h libqtpodincludes.path = $${QMAKE_INCDIR}/libqtpod + TARGET = qtpod + CONFIG += release \ + warn_on \ + dll + VERSION = 0.1.0 + TEMPLATE = lib HEADERS += ipoddevicedetails.h \ ipod.h \ *************** *** 34,41 **** track.cpp \ ipodmountpoint.cpp - TARGET = qtpod - CONFIG += release \ - warn_on \ - dll - VERSION = 0.1.0 - TEMPLATE = lib --- 40,41 ---- Index: ipod.cpp =================================================================== RCS file: /cvsroot/kpod/libqtpod/src/ipod.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ipod.cpp 2 Mar 2006 23:54:12 -0000 1.1 --- ipod.cpp 4 Mar 2006 15:56:31 -0000 1.2 *************** *** 23,27 **** IPod::IPod(const QString& mountPoint, const QString& device) ! : m_ipodBase( mountPoint ), m_itunesdb(), m_deviceDetails( mountPoint + IPOD_CONTROLDIR + "/iTunes/DeviceInfo" ), m_sysInfo( mountPoint, device ) --- 23,27 ---- IPod::IPod(const QString& mountPoint, const QString& device) ! : m_ipodBase( mountPoint ), m_itunesdb( mountPoint ), m_deviceDetails( mountPoint + IPOD_CONTROLDIR + "/iTunes/DeviceInfo" ), m_sysInfo( mountPoint, device ) *************** *** 40,44 **** } ! if ( !m_itunesdb.open( m_ipodBase ) ) { return false; } --- 40,44 ---- } ! if ( !m_itunesdb.open() ) { return false; } |