Skip to content

Instantly share code, notes, and snippets.

@diorahman
Created December 29, 2011 04:17
Show Gist options
  • Save diorahman/1531845 to your computer and use it in GitHub Desktop.
Save diorahman/1531845 to your computer and use it in GitHub Desktop.
Sendok
...
void Sendok::share(QString title, QString url)
{
#ifndef Q_WS_SIMULATOR
MDataUri dataUri;
dataUri.setMimeType("text/x-url");
dataUri.setTextData(url);
dataUri.setAttribute("title", title);
dataUri.setAttribute("description", "SendokGarpu: Search for Best Restaurants and Nigthlife!");
QStringList items;
items << dataUri.toString();
ShareUiInterface shareIf("com.nokia.ShareUi");
if (shareIf.isValid()) {
shareIf.share(items);
} else {
qCritical() << "Invalid interface";
}
#endif
}
...
...
#ifndef Q_WS_SIMULATOR
#include <maemo-meegotouch-interfaces/shareuiinterface.h>
#include <MDataUri>
#endif
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment