From cecea58356435bc499e021013a60ef8abebb5e78 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Mon, 10 Aug 2009 20:00:26 -0400 Subject: Formatting and OSX changes --- main.cpp | 6 +++--- moviefileselectorpage.h | 2 -- subtitleparser.cpp | 8 ++++---- subtitleparser.h | 26 +++++++++++++------------- subtitlepreviewpage.cpp | 1 + subtitlewizard.h | 2 +- 6 files changed, 22 insertions(+), 23 deletions(-) diff --git a/main.cpp b/main.cpp index 56f4937..38162de 100644 --- a/main.cpp +++ b/main.cpp @@ -9,7 +9,7 @@ int main(int argc, char *argv[]) a.setOrganizationName(QLatin1String("AnyClip")); a.setOrganizationDomain(QLatin1String("anyclip.com")); qRegisterMetaType("SubtitleParser*"); - SubtitleWizard w; - w.show(); - return a.exec(); + SubtitleWizard w; + w.show(); + return a.exec(); } diff --git a/moviefileselectorpage.h b/moviefileselectorpage.h index 98f944a..2788cb4 100644 --- a/moviefileselectorpage.h +++ b/moviefileselectorpage.h @@ -9,7 +9,6 @@ class MovieFileHolder : public QListWidget { Q_OBJECT Q_PROPERTY(QStringList movieFile READ movieFile NOTIFY currentItemChanged) - public: MovieFileHolder(QWidget *parent = 0); QStringList movieFile(); @@ -25,7 +24,6 @@ private: MovieFileHolder *m_movieList; void initializePage(); bool isComplete() const; - }; #endif // MOVIEFILESELECTORPAGE_H diff --git a/subtitleparser.cpp b/subtitleparser.cpp index 0942eda..cca19b9 100644 --- a/subtitleparser.cpp +++ b/subtitleparser.cpp @@ -76,10 +76,10 @@ quint64 SubtitleParser::parseTime(QString time) if (secs.length() != 2) return 0; return - split[0].toULongLong() * 60 * 60 * 1000 + - split[1].toULongLong() * 60 * 1000 + - secs[0].toULongLong() * 1000 + - secs[1].toULongLong(); + split[0].toULongLong() * 60 * 60 * 1000 + + split[1].toULongLong() * 60 * 1000 + + secs[0].toULongLong() * 1000 + + secs[1].toULongLong(); } QString SubtitleParser::fileName() const { diff --git a/subtitleparser.h b/subtitleparser.h index b864264..babfcc6 100644 --- a/subtitleparser.h +++ b/subtitleparser.h @@ -8,19 +8,19 @@ class Subtitle { - public: - Subtitle(QString text, quint64 start, quint64 stop); - bool isContainedIn(quint64 time) const; - void offsetTime(qint64 time); - QString text() const; - bool isAfter(quint64 time) const; - const QString toString() const; - private: - quint64 m_start; - quint64 m_stop; - qint64 m_offset; - QString m_text; - const QString formatTime(quint64 time) const; +public: + Subtitle(QString text, quint64 start, quint64 stop); + bool isContainedIn(quint64 time) const; + void offsetTime(qint64 time); + QString text() const; + bool isAfter(quint64 time) const; + const QString toString() const; +private: + quint64 m_start; + quint64 m_stop; + qint64 m_offset; + QString m_text; + const QString formatTime(quint64 time) const; }; class SubtitleParser { diff --git a/subtitlepreviewpage.cpp b/subtitlepreviewpage.cpp index 7bc0617..a284a13 100644 --- a/subtitlepreviewpage.cpp +++ b/subtitlepreviewpage.cpp @@ -67,6 +67,7 @@ bool SubtitlePreviewPage::validatePage() } void SubtitlePreviewPage::showSub(qint64 time) { + if (!m_subtitleParser) return; m_subTitle->setText(QString("
%1
").arg(m_subtitleParser->subtitleAtTime(time))); } void SubtitlePreviewPage::offsetSub(double timeOffset) diff --git a/subtitlewizard.h b/subtitlewizard.h index ddf50ab..fefd8e4 100644 --- a/subtitlewizard.h +++ b/subtitlewizard.h @@ -7,7 +7,7 @@ class SubtitleBrowserPage; class SubtitleWizard : public QWizard { - Q_OBJECT + Q_OBJECT public: SubtitleWizard(QWidget *parent = 0); -- cgit v1.2.3-59-g8ed1b