From b0e912c8b3d02a518fedda28c3180eb4794a7520 Mon Sep 17 00:00:00 2001 From: tpearson Date: Fri, 27 May 2011 23:37:00 +0000 Subject: TQt4 convert k9copy This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/k9copy@1233843 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- libk9copy/k9dvd.cpp | 91 +++++++++++++++++++++++++++-------------------------- 1 file changed, 46 insertions(+), 45 deletions(-) (limited to 'libk9copy/k9dvd.cpp') diff --git a/libk9copy/k9dvd.cpp b/libk9copy/k9dvd.cpp index 7ef0098..37a18ac 100755 --- a/libk9copy/k9dvd.cpp +++ b/libk9copy/k9dvd.cpp @@ -24,12 +24,13 @@ #include "k9cellcopylist.h" #include "k9dvdprogress.h" #include "k9ifo2.h" -#include +#include #include #include #include +#include "k9dvd.moc" k9DVDTitle* k9DVD::gettitle(int num) { return ((k9DVDTitle*)m_titles.at(num)); @@ -54,12 +55,12 @@ k9DVDTitle *k9DVD::getlongestTitle() { return m_longestTitle; } -/** Read property of QString title. */ -const QString& k9DVD::getDVDTitle() { +/** Read property of TQString title. */ +const TQString& k9DVD::getDVDTitle() { return m_title; } -void k9DVD::setDVDTitle(const QString &_newVal) { +void k9DVD::setDVDTitle(const TQString &_newVal) { m_title=_newVal; } @@ -81,7 +82,7 @@ int k9DVD::getmenuSize() { return m_menuSize; } -k9DVD::k9DVD(QObject *parent, const char *name,const QStringList args) { +k9DVD::k9DVD(TQObject *tqparent, const char *name,const TQStringList args) { m_error=false; m_opened=false; m_titles.setAutoDelete(true); @@ -149,7 +150,7 @@ k9DVD::k9DVD(QObject *parent, const char *name,const QStringList args) { m_lsubpType.append(i18n("reserved")); m_lsubpType.append(i18n("Director's comments")); m_lsubpType.append(i18n("Large director's comments")); - m_lsubpType.append(i18n("Director's comments for children")); + m_lsubpType.append(i18n("Director's comments for tqchildren")); m_frames_per_s[0]=-1.0; @@ -184,9 +185,9 @@ int k9DVD::dvdtime2msec(dvd_time_t *dt) { int k9DVD::get_title_name(const char* dvd_device, char* title) { FILE *filehandle = 0; int i; - QString c; + TQString c; if (! (filehandle = fopen(dvd_device, "r"))) { - c=i18n("Couldn't open %1 for title\n").arg(dvd_device); + c=i18n("Couldn't open %1 for title\n").tqarg(dvd_device); // setError(c ); strcpy(title, i18n("unknown").latin1()); return -1; @@ -194,7 +195,7 @@ int k9DVD::get_title_name(const char* dvd_device, char* title) { if ( fseek(filehandle, 32808, SEEK_SET )) { fclose(filehandle); - c=i18n("Couldn't seek in %1 for title\n").arg( dvd_device); + c=i18n("Couldn't seek in %1 for title\n").tqarg( dvd_device); setError(c); strcpy(title, i18n("unknown").latin1()); return -1; @@ -217,8 +218,8 @@ int k9DVD::get_title_name(const char* dvd_device, char* title) { return 0; } -QString k9DVD::lang_name(const QString& code,const QString & name) { - QString c; +TQString k9DVD::lang_name(const TQString& code,const TQString & name) { + TQString c; int i=0; lng arrLng[] = { { " ", i18n("Not Specified") }, { "aa", i18n("Afar") }, { "ab", i18n("Abkhazian") }, { "af", i18n("Afrikaans") }, { "am", i18n("Amharic")}, @@ -276,7 +277,7 @@ int k9DVD::calcNumTitle(ifo_handle_t *ifo,int _vts,int _ttn) { } -int k9DVD::scandvd (const QString & device,bool _quickScan) { +int k9DVD::scandvd (const TQString & device,bool _quickScan) { char ctitle[255]; k9DVDChapter::setcptChapter(0); ifo_handle_t *ifo_zero, *ifo; @@ -293,7 +294,7 @@ int k9DVD::scandvd (const QString & device,bool _quickScan) { int max_length = 0; bool ok; tt_srpt_t *tt_srpt; - QString txt,c; + TQString txt,c; m_start=NULL; int menuSizes[100]; @@ -307,29 +308,29 @@ int k9DVD::scandvd (const QString & device,bool _quickScan) { m_errMsg=""; if (!_quickScan) { - m_progressDlg= new k9DVDProgress(qApp->mainWidget(),"progress",true); + m_progressDlg= new k9DVDProgress(tqApp->mainWidget(),"progress",true); m_progressDlg->setpbTitleStep(0); m_progressDlg->setpbTotalStep(0); - connect(this, SIGNAL(sigVobProgress(unsigned int,unsigned int)), this, SLOT(slotVobProgress(unsigned int,unsigned int))); - connect(this, SIGNAL(sigTitleProgress(unsigned int,unsigned int)), this, SLOT(slotTitleProgress(unsigned int,unsigned int))); - connect(this, SIGNAL(sigTitleText(QString&)), this, SLOT(slotTitleText(QString&))); - connect(this, SIGNAL(sigTotalText(QString&)), this, SLOT(slotTotalText(QString&))); + connect(this, TQT_SIGNAL(sigVobProgress(unsigned int,unsigned int)), this, TQT_SLOT(slotVobProgress(unsigned int,unsigned int))); + connect(this, TQT_SIGNAL(sigTitleProgress(unsigned int,unsigned int)), this, TQT_SLOT(slotTitleProgress(unsigned int,unsigned int))); + connect(this, TQT_SIGNAL(sigTitleText(TQString&)), this, TQT_SLOT(slotTitleText(TQString&))); + connect(this, TQT_SIGNAL(sigTotalText(TQString&)), this, TQT_SLOT(slotTotalText(TQString&))); m_progressDlg->show(); } else m_progressDlg=NULL; - qApp->processEvents(); + tqApp->processEvents(); k9DVDTitle *l_track; k9DVDAudioStream *l_auds; k9DVDChapter *l_chap; k9DVDSubtitle *l_sub; - QString sh,sm,ss; + TQString sh,sm,ss; /* ret = stat(device.latin1(), &dvd_stat); if ( ret < 0 ) { - c=i18n("Can't find device %1\n").arg( device); + c=i18n("Can't find device %1\n").tqarg( device); setError(c); return 1; } @@ -339,7 +340,7 @@ int k9DVD::scandvd (const QString & device,bool _quickScan) { m_dvd.close(); m_dvd.openDevice(device); if( !m_dvd.opened() ) { - c=i18n("Can't open disc %1!\n").arg(device); + c=i18n("Can't open disc %1!\n").tqarg(device); setError(c); return 2; } @@ -392,8 +393,8 @@ int k9DVD::scandvd (const QString & device,bool _quickScan) { m_titleCount++; vts_ttn = ttn;//ifo->vts_ptt_srpt->title[j].ptt[0].pgcn; //ifo_zero->tt_srpt->title[j].vts_ttn; - //JMPtxt=i18n("Title %1").arg(indexedCount); - txt=i18n("Title %1").arg(numTitle); + //JMPtxt=i18n("Title %1").tqarg(indexedCount); + txt=i18n("Title %1").tqarg(numTitle); emit sigTotalText (txt); emit sigTitleProgress(numTitle,ltitles); video_attr = &vtsi_mat->vts_video_attr; @@ -430,7 +431,7 @@ int k9DVD::scandvd (const QString & device,bool _quickScan) { l_track->FPS = m_frames_per_s[(pgc->playback_time.frame_u & 0xc0) >> 6]; l_track->format= (*m_lvideoFormat.at(video_attr->video_format)); m_format = l_track->format; - /* QStringList::Iterator it; + /* TQStringList::Iterator it; it= videoFormat.at(video_attr->video_format); c= (*it).latin1(); */ @@ -442,7 +443,7 @@ int k9DVD::scandvd (const QString & device,bool _quickScan) { l_track->DF = (*m_lpermittedDf.at(video_attr->permitted_df)); for (i=0; i<16; i++) { - QString pal; + TQString pal; pal.sprintf("%08x",pgc->palette[i]); l_track->palette.append(pal); } @@ -574,7 +575,7 @@ int k9DVD::scandvd (const QString & device,bool _quickScan) { l_chap->length.setHMS(hour,minute,second); l_chap->sectors=sectors; if (l_pchap!=NULL) { - QTime t; + TQTime t; int position; t.setHMS(0,0,0); position=t.secsTo(l_chap->length); @@ -599,10 +600,10 @@ int k9DVD::scandvd (const QString & device,bool _quickScan) { subpc=(pgc->subp_control[i]>>16) & 0x1F; l_sub->id.append(1+ subpc); subpc=(pgc->subp_control[i]>>8) & 0x1F; - if (! l_sub->id.contains(1+ subpc) && ! l_track->DF.contains("noletterbox")) + if (! l_sub->id.tqcontains(1+ subpc) && ! l_track->DF.tqcontains("noletterbox")) l_sub->id.append(1+ subpc); subpc=pgc->subp_control[i] & 0x1F; - if (! l_sub->id.contains(1+ subpc) && ! l_track->DF.contains("nopanscan")) + if (! l_sub->id.tqcontains(1+ subpc) && ! l_track->DF.tqcontains("nopanscan")) l_sub->id.append(1+ subpc); } kdDebug() << "VTS: " << l_track->VTS << " TTN: " << l_track->TTN << \ @@ -690,7 +691,7 @@ k9DVDTitle* k9DVD::addTitle(k9DVDTitleset *_titleset,int id,int num,int _VTS,int } if (bappend) m_titles.append(track); - track->name=i18n("Title %1").arg(num); + track->name=i18n("Title %1").tqarg(num); if (!_indexed) { for (uint i=0;i=0x20) && (id <=0x3f)) { - if ( l_sub->id.contains(id - 0x20 +1) ) { + if ( l_sub->id.tqcontains(id - 0x20 +1) ) { l_sub->size_mb = streamList[x].size_mb; break; } @@ -855,10 +856,10 @@ long k9DVD::stream_vob( int title, unsigned long startblock, unsigned long lastb long total=0; unsigned long i, x ,nbread=0; ssize_t size; - QString c; + TQString c; dvdfile =m_dvd.openTitle( title); if( !dvdfile ) { - c=i18n("Error opening vobs for title %1\n").arg( title); + c=i18n("Error opening vobs for title %1\n").tqarg( title); setError(c); return 0; } @@ -869,7 +870,7 @@ long k9DVD::stream_vob( int title, unsigned long startblock, unsigned long lastb emit sigVobProgress(i-startblock,lastblock-startblock); total+=size; if( !size ) { - c=i18n("ERROR reading block %1\n").arg(i); + c=i18n("ERROR reading block %1\n").tqarg(i); setError(c); break; } @@ -993,26 +994,26 @@ float k9DVD::getfactor(bool _withMenus,bool _streams,bool _useDvdAuthor) { void k9DVD::slotVobProgress(unsigned int position,unsigned int total) { m_progressDlg->setpbTitleStep(position); m_progressDlg->setpbTitleTotalSteps(total); - qApp->processEvents(); + tqApp->processEvents(); } void k9DVD::slotTitleProgress(unsigned int position,unsigned int total) { m_progressDlg->setpbTotalStep(position); m_progressDlg->setpbTotalTotalSteps(total); - qApp->processEvents(); + tqApp->processEvents(); } -void k9DVD::slotTitleText(QString& text) { +void k9DVD::slotTitleText(TQString& text) { m_progressDlg->setlblTitle(text); - qApp->processEvents(); + tqApp->processEvents(); } -void k9DVD::slotTotalText(QString& text) { +void k9DVD::slotTotalText(TQString& text) { m_progressDlg->setlblTotal(text); - qApp->processEvents(); + tqApp->processEvents(); } -const QString& k9DVD::getDevice() { +const TQString& k9DVD::getDevice() { return m_Device; } @@ -1020,11 +1021,11 @@ const bool& k9DVD::geterror() { return m_error; } -const QString& k9DVD::geterrMsg() { +const TQString& k9DVD::geterrMsg() { return m_errMsg; } -void k9DVD::setError(const QString & err) { +void k9DVD::setError(const TQString & err) { m_error=true; m_errMsg=err; if (m_progressDlg !=NULL) @@ -1036,7 +1037,7 @@ const bool& k9DVD::getopened() { } -QString &k9DVD::getFormat() { +TQString &k9DVD::getFormat() { return (m_format); } -- cgit v1.2.1