Skip to content

Commit

Permalink
new version for 0.5, start support of RPATH, delay loading symboltables,
Browse files Browse the repository at this point in the history
multiple dependency types, bundle name or installation name and much
more...
  • Loading branch information
kwin committed Jun 3, 2009
1 parent 4a2d80d commit e358e03
Show file tree
Hide file tree
Showing 40 changed files with 652 additions and 303 deletions.
13 changes: 7 additions & 6 deletions macdependency/Info_mac.plist
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,27 @@
<plist version="1.0">
<dict>
<key>CFBundleVersion</key>
<string>0.5</string>
<string>0.5.0</string>
<key>CFBundleIconFile</key>
<string>@ICON@</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>@TYPEINFO@</string>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>ttxt</string>
<key>CFBundleGetInfoString</key>
<string>Created by Qt/QMake</string>
<key>CFBundleIdentifier</key>
<string>com.googlecode.macdependency</string>
<key>CFBundleSignature</key>
<string>ttxt</string>
<key>CFBundleExecutable</key>
<string>@EXECUTABLE@</string>
<key>CFBundleName</key>
<string>MacDependency</string>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>*</string>
<string>app</string>
<string>dylib</string>
</array>
Expand Down
62 changes: 57 additions & 5 deletions macdependency/aboutdialog.cpp
Original file line number Diff line number Diff line change
@@ -1,24 +1,50 @@
#include "aboutdialog.h"
#include "ui_aboutdialog.h"

#include <QtCore/QDate>
#include <QtCore/QSysInfo>
#include <CoreFoundation/CoreFoundation.h>

#define AUTHOR "Konrad Windszus"

AboutDialog::AboutDialog(QWidget *parent) :
QDialog(parent),
m_ui(new Ui::AboutDialog)
QDialog(parent),
ui(new Ui::AboutDialog)
{
m_ui->setupUi(this);
ui->setupUi(this);

QDate date = QDate::fromString(__DATE__, "MMM d yyyy");
if (date.isNull()) {
date = QDate::fromString(__DATE__, "MMM d yyyy");
}

const QString description = tr(
"Version %1\n"
"Based on Qt %2 (%3 bit)\n"
"Built on %4 at %5\n"
"Copyright 2009-%6 %7. All rights reserved.\n"
"\n"
"The program is provided AS IS with NO WARRANTY OF ANY KIND,\n"
"INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A\n"
"PARTICULAR PURPOSE.")
.arg(getBundleVersion(), QLatin1String(QT_VERSION_STR), QString::number(QSysInfo::WordSize),
date.toString(), QLatin1String(__TIME__), date.toString("yyyy"),
(QLatin1String(AUTHOR)));

ui->descriptionLabel->setText(description);
}

AboutDialog::~AboutDialog()
{
delete m_ui;
delete ui;
}

void AboutDialog::changeEvent(QEvent *e)
{
QDialog::changeEvent(e);
switch (e->type()) {
case QEvent::LanguageChange:
m_ui->retranslateUi(this);
ui->retranslateUi(this);
break;
default:
break;
Expand All @@ -28,3 +54,29 @@ void AboutDialog::changeEvent(QEvent *e)
void AboutDialog::on_aboutQtButton_clicked() {
qApp->aboutQt();
}

QString AboutDialog::getBundleVersion() {
QString version;
CFBundleRef bundle = CFBundleGetMainBundle();

CFStringRef cfVersion = (CFStringRef)CFBundleGetValueForInfoDictionaryKey(bundle, kCFBundleVersionKey);
// is version available at all?
if (cfVersion) {
const char* szVersion = CFStringGetCStringPtr(cfVersion, kCFStringEncodingASCII);
if (szVersion == NULL) {
CFIndex versionLength = CFStringGetMaximumSizeForEncoding(CFStringGetLength(cfVersion), kCFStringEncodingASCII);

char szVersionNew[versionLength + 1];
if (CFStringGetCString(cfVersion,
szVersionNew,
versionLength+1,
kCFStringEncodingASCII
))
version = szVersionNew;
delete[] szVersion;
} else {
version = szVersion;
}
}
return version;
}
4 changes: 3 additions & 1 deletion macdependency/aboutdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ private slots:
void on_aboutQtButton_clicked();

private:
Ui::AboutDialog *m_ui;
Ui::AboutDialog *ui;

QString getBundleVersion();
};

#endif // ABOUTDIALOG_H
59 changes: 25 additions & 34 deletions macdependency/aboutdialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,10 @@
<rect>
<x>0</x>
<y>0</y>
<width>306</width>
<height>240</height>
<width>332</width>
<height>200</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="windowTitle">
<string>About MacDependency</string>
</property>
Expand All @@ -44,24 +38,25 @@
</widget>
</item>
<item>
<widget class="QLabel" name="label_2">
<widget class="QLabel" name="descriptionLabel">
<property name="text">
<string>Version 0.4</string>
<string/>
</property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_3">
<property name="text">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Lucida Grande'; font-size:13pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Copyright 2009 by Konrad Windszus&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;a href=&quot;http://code.google.com/p/macdependency/&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;http://code.google.com/p/macdependency/&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>&lt;a href=&quot;http://code.google.com/p/macdependency&quot;&gt;http://code.google.com/p/macdependency&lt;/a&gt;</string>
</property>
<property name="textFormat">
<enum>Qt::RichText</enum>
<enum>Qt::AutoText</enum>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
Expand All @@ -84,9 +79,15 @@ p, li { white-space: pre-wrap; }
<number>0</number>
</property>
<item>
<widget class="QLabel" name="label_4">
<widget class="QPushButton" name="aboutQtButton">
<property name="text">
<string>built with Qt</string>
<string>About Qt...</string>
</property>
<property name="autoDefault">
<bool>false</bool>
</property>
<property name="flat">
<bool>false</bool>
</property>
</widget>
</item>
Expand All @@ -104,27 +105,17 @@ p, li { white-space: pre-wrap; }
</spacer>
</item>
<item>
<widget class="QPushButton" name="aboutQtButton">
<property name="text">
<string>About Qt...</string>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="flat">
<bool>false</bool>
<property name="standardButtons">
<set>QDialogButtonBox::Close</set>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Close</set>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
Expand Down
Loading

0 comments on commit e358e03

Please sign in to comment.