Skip to content

Commit

Permalink
remove dependency of version.h. add runtime version string functions
Browse files Browse the repository at this point in the history
  • Loading branch information
wang-bin committed Mar 14, 2013
1 parent 9acdb11 commit d4c51d5
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 8 deletions.
2 changes: 1 addition & 1 deletion examples/player-d2d/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ int main(int argc, char *argv[])
return 0;
}
renderer.show();
renderer.setWindowTitle("QtAV " QTAV_VERSION_STR_LONG " [email protected]");
renderer.setWindowTitle("QtAV " + QtAV_Version_String_Long() + " [email protected]");
//renderer.resize(800, 600);
QString fileName;
if (argc > 1)
Expand Down
2 changes: 1 addition & 1 deletion examples/player-gdi/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ int main(int argc, char *argv[])
*/
GDIRenderer renderer;
renderer.show();
renderer.setWindowTitle("QtAV " QTAV_VERSION_STR_LONG " [email protected]");
renderer.setWindowTitle("QtAV " + QtAV_Version_String_Long() + " [email protected]");
//renderer.resize(800, 600);
QString fileName;
if (argc > 1)
Expand Down
2 changes: 1 addition & 1 deletion examples/player-gl/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ int main(int argc, char *argv[])

GLWidgetRenderer renderer;
renderer.show();
renderer.setWindowTitle("QtAV " QTAV_VERSION_STR_LONG " [email protected]");
renderer.setWindowTitle("QtAV " + QtAV_Version_String_Long() + " [email protected]");
//renderer.resize(800, 600);
QString fileName;
if (argc > 1)
Expand Down
2 changes: 1 addition & 1 deletion examples/simpleplayer/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ int main(int argc, char *argv[])
vo = vo.toLower();
if (vo != "gl" && vo != "d2d" && vo != "gdi")
vo = "qpainter";
QString title = "QtAV " + vo + " " QTAV_VERSION_STR_LONG " [email protected]";
QString title = "QtAV " + vo + " " + QtAV_Version_String_Long() + " [email protected]";
VideoRenderer *renderer = 0;
if (vo == "gl") {
GLWidgetRenderer *r = static_cast<GLWidgetRenderer*>(VideoRendererFactory::create(VideoRendererId_GLWidget));
Expand Down
4 changes: 2 additions & 2 deletions src/QtAV/QtAV_Global.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@

#include <qglobal.h>
#include <dptr.h>
#include "QtAV/version.h"

#if defined(Q_DLL_LIBRARY)
# undef Q_EXPORT
Expand All @@ -37,7 +36,8 @@

/* runtime version. used to compare with compile time version */
Q_EXPORT unsigned QtAV_Version();

Q_EXPORT QString QtAV_Version_String();
Q_EXPORT QString QtAV_Version_String_Long();

// default network timeout in ms
#define QTAV_DEFAULT_NETWORK_TIMEOUT 30000
Expand Down
1 change: 1 addition & 0 deletions src/QtAV_Compat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
******************************************************************************/

#include <QtAV/QtAV_Compat.h>
#include "QtAV/version.h"
#include "prepost.h"

void ffmpeg_version_print()
Expand Down
11 changes: 11 additions & 0 deletions src/QtAV_Global.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,23 @@
#include <QtAV/QtAV_Global.h>
#include <QtCore/QObject>
#include <QtCore/QRegExp>
#include "QtAV/version.h"

unsigned QtAV_Version()
{
return QTAV_VERSION;
}

QString QtAV_Version_String()
{
return QTAV_VERSION_STR;
}

QString QtAV_Version_String_Long()
{
return QTAV_VERSION_STR_LONG;
}

namespace QtAV {

QString aboutQtAV()
Expand Down
2 changes: 1 addition & 1 deletion tests/clockcontrol/widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ using namespace QtAV;
Widget::Widget(QWidget *parent) :
QWidget(parent)
{
setWindowTitle("A test for [clock controlling]. QtAV" QTAV_VERSION_STR_LONG " [email protected]");
setWindowTitle("A test for [clock controlling]. QtAV" + QtAV_Version_String_Long() + " [email protected]");
clock = new AVClock(this);
clock->setClockType(AVClock::ExternalClock);
QVBoxLayout *main_layout = new QVBoxLayout;
Expand Down
2 changes: 1 addition & 1 deletion tests/sharedoutput/widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ using namespace QtAV;
Widget::Widget(QWidget *parent) :
QWidget(parent)
{
setWindowTitle("A test for shared video renderer. QtAV" QTAV_VERSION_STR_LONG " [email protected]");
setWindowTitle("A test for shared video renderer. QtAV" + QtAV_Version_String_Long() + " [email protected]");
QVBoxLayout *main_layout = new QVBoxLayout;
QHBoxLayout *btn_layout = new QHBoxLayout;
renderer = new WidgetRenderer;
Expand Down

0 comments on commit d4c51d5

Please sign in to comment.