Path.Combine(ContentsDir, "Resources\\Tokens");
Sooooo close yet so far. Also, I don't know anyone that does it right the first time, EVER.
🪼

Andulka

if i look back, i am lost
noise dept.
Misplaced Lens Cap

Kaledo Art
AnasAbdin
Sade Olutola

titsay

No title available

@theartofmadeline
Mike Driver

JBB: An Artblog!
Claire Keane
ojovivo
PUT YOUR BEARD IN MY MOUTH

pixel skylines
will byers stan first human second

blake kathryn
Aqua Utopia|海の底で記憶を紡ぐ

seen from United Kingdom
seen from United States
seen from United States

seen from United States
seen from United States
seen from United States
seen from United States
seen from United States
seen from United States

seen from United States
seen from United States
seen from United States

seen from New Zealand

seen from United States

seen from Singapore

seen from Malaysia
seen from Russia
seen from Malaysia

seen from United States
seen from Egypt
@the-macaque-blog
Path.Combine(ContentsDir, "Resources\\Tokens");
Sooooo close yet so far. Also, I don't know anyone that does it right the first time, EVER.
An illustrated collection of (sometimes violent) fables, concerning the Art and Philosophy of software development
Huge fan.
Some people shold not be allowed to code!
Good question for our industry.
Say command
rolf: heh, try executing "say 1th 2th 3th" in a terminal
mandel: wtf? hahaha
mandel: first, why are you saying 1th, 2th, 3th.. and second, how did you find that out?
rolf: `C=0; while make exec-ios-sim64-mscorlib; do let C++; say trying again for the ${C}th time; echo "trying again for the ${C}th time"; done; say test run failed after $C attempts`
mandel: say ola pepsicola
mandel: the terminal does not pronounce the hola properly
alan: try `say oooo oo o ooooo o oooo oooo ooooo`(edited)
mandel: hacks a simon say version
rolf: `say oooo oo o ooooo o oooo oooo ooooo -v Cellos`
Best quote:
Don't make your clients happy
More designers should know it.
5 languages to know.
5 laguages to know.
Working with screens with different pixel density.. it is a harder problem than yu think.
Sorting algorithms.
Unit pipeline
The xamarin monkey joined then gang.
Halloween at xamarin
Halloween at xamarin hq!
Visiting the xamarin Boston office
NYC facades
Issues with exposed properties in QML
Recently I have been working on an update for the Ubuntu Download Manager QML bindings that would allow to pass a Metadata object on the creation of a download that can be used to set a number of flags that the download manager would take into account. The following is an example of its usage:
import Ubuntu.DownloadManager 0.1 SingleDownload { metadata: Metadata { deflate: true } }
Interestingly enough the above code gave the following error:
"Unable to assign Ubuntu::DownloadManager::Metadata to [unknown property type]"
The above is quite surprising because the Metadata object is a simple QObject derived object that exposes a number of properties, here you can see the header file:
/* * Copyright 2014 Canonical Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of version 3 of the GNU Lesser General Public * License as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef METADATA_H #define METADATA_H #include namespace Ubuntu { namespace DownloadManager { class Metadata : public QObject { Q_OBJECT Q_PROPERTY(QString title READ title WRITE setTitle NOTIFY titleChanged) Q_PROPERTY(bool showInIndicator READ showInIndicator WRITE setShowInIndicator NOTIFY showIndicatorChanged) Q_PROPERTY(bool deflate READ deflate WRITE setDeflate NOTIFY deflateChanged) public: explicit Metadata(QObject* parent=0); Metadata(QVariantMap map, QObject* parent=0); QString title() const; void setTitle(QString title); bool showInIndicator() const; void setShowInIndicator(bool shown); bool deflate() const; void setDeflate(bool deflate); QVariantMap map() const; signals: void titleChanged(); void showIndicatorChanged(); void deflateChanged(); private: Transfers::Metadata _metadata; }; } // Ubuntu } // DownloadManager #endif
While the SingleDownload object is defined as:
/* * Copyright 2014 Canonical Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of version 3 of the GNU Lesser General Public * License as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef FILE_DOWNLOAD_H #define FILE_DOWNLOAD_H #include #include #include #include #include "metadata.h" #include "download_error.h" namespace Ubuntu { namespace DownloadManager { class SingleDownload : public QObject { Q_OBJECT Q_PROPERTY(bool autoStart READ autoStart WRITE setAutoStart) Q_PROPERTY(QString errorMessage READ errorMessage NOTIFY errorChanged) Q_PROPERTY(bool isCompleted READ isCompleted NOTIFY isCompletedChanged) Q_PROPERTY(bool downloadInProgress READ downloadInProgress NOTIFY downloadInProgressChanged) Q_PROPERTY(bool allowMobileDownload READ allowMobileDownload WRITE setAllowMobileDownload NOTIFY allowMobileDownloadChanged) Q_PROPERTY(qulonglong throttle READ throttle WRITE setThrottle NOTIFY throttleChanged) Q_PROPERTY(int progress READ progress NOTIFY progressChanged) Q_PROPERTY(bool downloading READ downloading NOTIFY downloadingChanged) Q_PROPERTY(QString downloadId READ downloadId NOTIFY downloadIdChanged) Q_PROPERTY(QVariantMap headers READ headers WRITE setHeaders NOTIFY headersChanged) Q_PROPERTY(Metadata* metadata READ metadata WRITE setMetadata NOTIFY metadataChanged) public: explicit SingleDownload(QObject *parent = 0); Q_INVOKABLE void start(); Q_INVOKABLE void pause(); Q_INVOKABLE void resume(); Q_INVOKABLE void cancel(); Q_INVOKABLE void download(QString url); void startDownload(); // getters bool isCompleted() const { return m_completed; } DownloadError& error() { return m_error; } QString errorMessage() const { return m_error.message(); } qulonglong throttle() const; bool allowMobileDownload() const; int progress() const { return m_progress; } bool downloading() const { return m_downloading; } bool downloadInProgress() const { return m_downloadInProgress; } bool autoStart() const { return m_autoStart; } QString downloadId() const; QVariantMap headers() const; Metadata* metadata() const; // setters void setAllowMobileDownload(bool value); void setThrottle(qulonglong value); void setHeaders(QVariantMap headers); void setMetadata(Metadata* metadata); // only property that does not access the download obj void setAutoStart(bool value) { m_autoStart = value; } protected: SingleDownload(Download* down, Manager* man, QObject *parent = 0); signals: void isCompletedChanged(); void allowMobileDownloadChanged(); void throttleChanged(); void progressChanged(); void downloadingChanged(); void downloadInProgressChanged(); void downloadIdChanged(); void headersChanged(); void metadataChanged(); void canceled(bool success); void finished(const QString& path); void paused(bool success); void processing(const QString &path); void progressReceived(qulonglong received, qulonglong total); void resumed(bool success); void started(bool success); void errorFound(DownloadError& error); void errorChanged(); public slots: void registerError(Error* error); void bindDownload(Download* download); void unbindDownload(Download* download); void onFinished(const QString& path); void onProgress(qulonglong received, qulonglong total); void onPaused(bool wasPaused); void onResumed(bool wasResumed); void onStarted(bool wasStarted); void onCanceled(bool wasCanceled); private: QString getErrorType(Error::Type type) { switch (type) { case Error::Auth: return QString("Auth"); case Error::DBus: return QString("DBus"); case Error::Http: return QString("Http"); case Error::Network: return QString("Network"); case Error::Process: return QString("Process"); default: return QString(); } } private: bool m_autoStart; bool m_completed; bool m_downloading; bool m_dirty = false; bool m_downloadInProgress; int m_progress; bool m_mobile = false; qulonglong m_throttle = 0; QVariantMap m_headers; Metadata* m_metadata = nullptr; DownloadError m_error; Download* m_download = nullptr; Manager* m_manager = nullptr; }; } } #endif // FILE_DOWNLOAD_H
And both objects are registered to the QML as follows:
qmlRegisterType(uri, 0, 1, "Error"); qmlRegisterType(uri, 0, 1, "Metadata"); qmlRegisterType(uri, 0, 1, "SingleDownload"); qmlRegisterType(uri, 0, 1, "DownloadManager");
At a first glace everything is ok but there is a small error in there that makes the Q_PROPERTY definiton not to work. The problem is that moc doe not have the same type system as C++. It just knows stringg and so does QMetaObject, therefore "Foo::Bar" != "Bar". Once we know this fact we can easily spot the error, look at the registration of the Metadata object and its uses in the Q_PROPERTY macro:
// registration qmlRegisterType(uri, 0, 1, "Metadata"); // property Q_PROPERTY(Metadata* metadata READ metadata WRITE setMetadata NOTIFY metadataChanged)
As you can see the registration is taking the full namespace while the property is not. The simplest way to fix this bug is to use the full namespace in the Q_PROPERTY too:
Q_PROPERTY(Ubuntu::DownloadManaer::Metadata* metadata READ metadata WRITE setMetadata NOTIFY metadataChanged)