bool soomla::CCLeaderboard::init(cocos2d::__String *id, cocos2d::__String *provider, cocos2d::__String *name, cocos2d::__String *iconUrl) {

    setId(id);
    setProvider(provider);
    setName(name);
    setIconUrl(iconUrl);

    return true;
}
GVBrowserExtension::GVBrowserExtension(KParts::ReadOnlyPart* part)
: KParts::BrowserExtension(part)
, d(new GVBrowserExtensionPrivate)
{
    d->mPart = part;
    emit enableAction("print", true);
    QString iconPath = KIconLoader::global()->iconPath("image-x-generic", KIconLoader::SizeSmall);
    emit setIconUrl(KUrl::fromPath(iconPath));
}
Beispiel #3
0
WebKitNotification::WebKitNotification(const String& title, const String& body, const String& iconUrl, ExecutionContext* context, ExceptionState& es, PassRefPtr<NotificationCenter> provider)
    : NotificationBase(title, context, provider->client())
{
    ScriptWrappable::init(this);

    if (provider->checkPermission() != NotificationClient::PermissionAllowed) {
        es.throwSecurityError("Notification permission has not been granted.");
        return;
    }

    KURL icon = iconUrl.isEmpty() ? KURL() : executionContext()->completeURL(iconUrl);
    if (!icon.isEmpty() && !icon.isValid()) {
        es.throwDOMException(SyntaxError, "'" + iconUrl + "' is not a valid icon URL.");
        return;
    }

    setBody(body);
    setIconUrl(icon);
}
::kj::Promise<void> BackendServer::getCoinDetails(Backend::Server::GetCoinDetailsContext context)
{
    auto results = context.getResults().initDetails();
    results.setIconUrl("https://followmyvote.com/wp-content/uploads"
                                                  "/2014/02/Follow-My-Vote-Logo.png");
    results.setActiveContestCount(15);

    auto historyLength = context.getParams().getVolumeHistoryLength();
    if (historyLength <= 0)
        results.getVolumeHistory().setNoHistory();
    else {
        auto history = results.getVolumeHistory().initHistory();
        // Get current time, rewound to the most recent hour
        history.setHistoryEndTimestamp(
                    std::chrono::duration_cast<std::chrono::milliseconds>(
                        std::chrono::system_clock::now().time_since_epoch()
                    ).count() / (1000 * 60 * 60) * (1000 * 60 * 60));
        // TODO: test that this logic for getting the timestamp is correct
        auto histogram = history.initHistogram(historyLength);
        for (int i = 0; i < historyLength; ++i)
            histogram.set(i, 1000000);
    }
    return kj::READY_NOW;
}