Skip to content

Commit

Permalink
Added new stuff.
Browse files Browse the repository at this point in the history
  • Loading branch information
cuzbog committed Nov 28, 2014
1 parent ee3783e commit ee2e5d3
Show file tree
Hide file tree
Showing 10 changed files with 9 additions and 17 deletions.
8 changes: 4 additions & 4 deletions CMakeLists.txt.user
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 3.1.1, 2014-11-20T19:31:31. -->
<!-- Written by QtCreator 3.1.1, 2014-11-26T21:48:15. -->
<qtcreator>
<data>
<variable>ProjectExplorer.Project.ActiveTarget</variable>
<value type="int">0</value>
<value type="int">1</value>
</data>
<data>
<variable>ProjectExplorer.Project.EditorSettings</variable>
Expand Down Expand Up @@ -252,8 +252,8 @@
<value type="QString">/var/lib/schroot/chroots/click-ubuntu-sdk-14.10-armhf</value>
</valuelist>
<valuelist type="QVariantList" key="Qt4ProjectManager.MaemoRunConfiguration.LastDeployedTimes">
<value type="QDateTime">2014-11-19T18:08:12</value>
<value type="QDateTime">2014-11-19T18:08:12</value>
<value type="QDateTime">2014-11-26T21:27:42</value>
<value type="QDateTime">2014-11-26T21:27:42</value>
</valuelist>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
Expand Down
2 changes: 1 addition & 1 deletion data/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ install(
FILES
"art.png"
"logo.svg"
"mixcloud.svg"
"screenshot.png"
DESTINATION
"${SCOPE_INSTALL_DIR}"
)
Expand Down
Binary file modified data/art.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions data/com.ubuntu.developer.boghison.mixcloud_mixcloudscope.ini
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[ScopeConfig]
DisplayName = MixCloud Scope
DisplayName = MixCloud
Description = This is a MixCloud scope
Art = art.png
Art = screenshot.png
Author = Firstname Lastname
Icon = icon.png
Icon = art.png

[Appearance]
PageHeader.Logo = logo.svg
Expand Down
Binary file added data/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion include/api/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ struct Config {
/*
* The root of all API request URLs
*/
std::string installdir { "" };
std::string apiroot { "http://api.mixcloud.com" };

/*
Expand Down
1 change: 0 additions & 1 deletion include/scope/query.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ class Query: public unity::scopes::SearchQueryBase {
void parseCasts(unity::scopes::CategorisedResult &hotRes, const api::Client::CloudCast &hotCast);

private:
std::string installdir;
api::Client client_;
void initScope();
bool showNew;
Expand Down
2 changes: 0 additions & 2 deletions src/api/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#include <unity/scopes/QueryMetadata.h>
#include <QVariantMap>
#include <math.h>
#include <QDebug>
#include <boost/algorithm/string/replace.hpp>


Expand Down Expand Up @@ -56,7 +55,6 @@ void Client::get(const net::Uri::Path &path,
net::Uri uri = net::make_uri(config_->apiroot, path, parameters);
std::string temporaryUri = client->uri_to_string(uri);
configuration.uri = boost::replace_all_copy(temporaryUri, "%20", "+");
qDebug(configuration.uri.c_str());
// Give out a user agent string
configuration.header.add("User-Agent", config_->user_agent);

Expand Down
5 changes: 1 addition & 4 deletions src/scope/query.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,11 @@ using namespace scope;
*
* The icons are larger.
*/
const static string TRACKS_TEMPLATE = "{\"schema-version\":1,\"template\":{\"category-layout\":\"grid\",\"card-layout\":\"horizontal\",\"card-size\":\"medium\"},\"components\":{\"title\":\"title\",\"art\":{\"field\":\"art\"},\"subtitle\":\"subtitle\",\"attributes\":\"attributes\",\"emblem\":\"emblem\"}}";
const static string TRACKS_TEMPLATE = "{\"schema-version\":1,\"template\":{\"category-layout\":\"grid\",\"card-layout\":\"horizontal\",\"card-size\":\"medium\"},\"components\":{\"title\":\"title\",\"art\":{\"field\":\"art\"},\"subtitle\":\"subtitle\",\"attributes\":\"attributes\"}}";
const static string USERS_TEMPLATE = "{\"schema-version\":1,\"components\":{\"title\":\"title\",\"art\":{\"field\":\"art\"}, \"subtitle\": \"subtitle\", \"attributes\": \"attributes\", \"emblem\": \"emblem\"}}";
Query::Query(const sc::CannedQuery &query, const sc::SearchMetadata &metadata,
Config::Ptr config) :
sc::SearchQueryBase(query, metadata), client_(config) {
Query::installdir = config->installdir;
}

void Query::cancelled() {
Expand Down Expand Up @@ -115,7 +114,6 @@ void Query::run(sc::SearchReplyProxy const& reply) {
}

void Query::parseCasts(sc::CategorisedResult &hotRes, const api::Client::CloudCast &hotCast){
string emblemPath = Query::installdir + "/mixcloud.svg";
hotRes.set_uri(hotCast.url);
hotRes.set_title(hotCast.name);
hotRes.set_art(hotCast.thumbnail);
Expand All @@ -140,7 +138,6 @@ void Query::parseCasts(sc::CategorisedResult &hotRes, const api::Client::CloudCa
builder.add_tuple({{"value", sc::Variant("" + hotCast.audio_length)}});
builder.add_tuple({{"value", sc::Variant(myValue)}});
hotRes["attributes"] = builder.end();
hotRes["emblem"] = emblemPath;
}


1 change: 0 additions & 1 deletion src/scope/scope.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ using namespace scope;

void Scope::start(string const&) {
config_ = make_shared<Config>();
config_->installdir = ScopeBase::scope_directory();

setlocale(LC_ALL, "");
string translation_directory = ScopeBase::scope_directory()
Expand Down

0 comments on commit ee2e5d3

Please sign in to comment.