Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: kdeplasma-addons-4.3.80/applets/microblog/microblog.cpp
- ===================================================================
- --- kdeplasma-addons-4.3.80.orig/applets/microblog/microblog.cpp 2009-12-05 16:52:57.999271256 +0100
- +++ kdeplasma-addons-4.3.80/applets/microblog/microblog.cpp 2009-12-05 17:04:30.729271246 +0100
- @@ -27,6 +27,7 @@
- #include <QGraphicsAnchorLayout>
- #include <QAction>
- #include <QTimer>
- +#include <QFile>
- #include <KColorScheme>
- #include <KConfigDialog>
- @@ -164,7 +165,7 @@
- m_serviceUrl = cg.readEntry("serviceUrl", "https://identi.ca/api/");
- m_username = cg.readEntry("username");
- m_password = KStringHandler::obscure(cg.readEntry("password"));
- - m_historySize = cg.readEntry("historySize", 6);
- + m_historySize = cg.readEntry("historySize", 10);
- m_historyRefresh = cg.readEntry("historyRefresh", 5);
- m_includeFriends = cg.readEntry("includeFriends", true);
- @@ -202,8 +203,10 @@
- m_layout->addItem(flashLayout);
- m_headerFrame = new Plasma::Frame(this);
- - m_headerLayout = new QGraphicsAnchorLayout(m_headerFrame);
- + m_headerLayout = new QGraphicsLinearLayout( Qt::Horizontal, m_headerFrame );
- m_headerLayout->setSpacing( 5 );
- +
- + m_layout->addItem( m_headerFrame );
- m_icon = new Plasma::IconWidget(m_headerFrame);
- m_icon->setIcon(KIcon("user-identity"));
- @@ -261,6 +264,7 @@
- //set things in motion
- if (m_username.isEmpty()) {
- setAuthRequired(true);
- + downloadHistory();
- } else if (m_password.isEmpty()) {
- kDebug() << "started, password is not in config file, trying wallet";
- m_walletWait = Read;
- @@ -351,7 +355,9 @@
- } else if (m_password.isEmpty()) {
- //FIXME: when out of string freeze, tell the user WHY they need
- // to configure the widget;
- - setConfigurationRequired(true);
- + if (!QFile::exists("/usr/bin/ubiquity")) { //don't show on live CD
- + setConfigurationRequired(true);
- + }
- kDebug() << "failed to read password";
- }
- @@ -376,7 +382,9 @@
- void MicroBlog::setAuthRequired(bool required)
- {
- - setConfigurationRequired(required);
- + if (!QFile::exists("/usr/bin/ubiquity")) {
- + setConfigurationRequired(required);
- + }
- m_statusEdit->setEnabled(!required);
- }
- @@ -752,11 +760,18 @@
- {
- //kDebug() ;
- if (m_username.isEmpty() || m_password.isEmpty()) {
- + /*
- if (!m_curTimeline.isEmpty()) {
- m_engine->disconnectSource(m_curTimeline, this);
- m_engine->disconnectSource("Error:" + m_curTimeline, this);
- }
- return;
- + */
- + m_username = "kubuntu"; //default to show when unconfigured
- + m_headerFrame->hide();
- + } else {
- + m_headerFrame->show();
- + }
- }
- m_flash->flash(i18n("Refreshing timeline..."), -1);
- @@ -767,7 +782,9 @@
- } else {
- createTimelineService();
- KConfigGroup cg = m_service->operationDescription("auth");
- - cg.writeEntry("password", m_password);
- + if (!m_password.isEmpty()) {
- + cg.writeEntry("password", m_password);
- + }
- m_service->startOperationCall(cg);
- }
- Index: kdeplasma-addons-4.3.80/applets/microblog/microblog.h
- ===================================================================
- --- kdeplasma-addons-4.3.80.orig/applets/microblog/microblog.h 2009-12-05 16:52:57.989272846 +0100
- +++ kdeplasma-addons-4.3.80/applets/microblog/microblog.h 2009-12-05 17:05:16.059272118 +0100
- @@ -137,7 +137,8 @@
- QGraphicsWidget *m_tweetsWidget;
- QGraphicsLinearLayout *m_tweetsLayout;
- QGraphicsLinearLayout *m_layout;
- - QGraphicsAnchorLayout *m_headerLayout;
- + QGraphicsAnchorLayout *m_headerLayout;
- + Plasma::Frame *m_headerFrame;
- QGraphicsWidget *m_graphicsWidget;
- QPixmap m_popupIcon;
- Index: kdeplasma-addons-4.3.80/dataengines/microblog/timelinesource.cpp
- ===================================================================
- --- kdeplasma-addons-4.3.80.orig/dataengines/microblog/timelinesource.cpp 2009-12-05 16:53:23.151146460 +0100
- +++ kdeplasma-addons-4.3.80/dataengines/microblog/timelinesource.cpp 2009-12-05 17:07:09.699272171 +0100
- @@ -97,6 +97,9 @@
- case TimelineWithFriends:
- m_url = KUrl(m_serviceBaseUrl, "statuses/friends_timeline.xml");
- break;
- + case NoAuth:
- + m_url = KUrl(m_serviceBaseUrl, QString("statuses/user_timeline/%1.xml").arg(account.at(0)));
- + break;
- case Timeline:
- default:
- m_url = KUrl(m_serviceBaseUrl, "statuses/user_timeline.xml");
- @@ -141,7 +144,7 @@
- void TimelineSource::update(bool forcedUpdate)
- {
- - if (m_job || (!account().isEmpty() && password().isEmpty())) {
- + if ( account() != "kubuntu" && (m_job || (!account().isEmpty() &&password().isEmpty())) ) {
- // We are already performing a fetch, let's not bother starting over
- //kDebug() << "already updating....." << m_job << account().isEmpty() << password().isEmpty();
- return;
- Index: kdeplasma-addons-4.3.80/dataengines/microblog/timelinesource.h
- ===================================================================
- --- kdeplasma-addons-4.3.80.orig/dataengines/microblog/timelinesource.h 2009-12-05 16:53:23.140644082 +0100
- +++ kdeplasma-addons-4.3.80/dataengines/microblog/timelinesource.h 2009-12-05 17:07:36.170510838 +0100
- @@ -80,7 +80,8 @@
- TimelineWithFriends,
- Replies,
- DirectMessages,
- - Profile
- + Profile,
- + NoAuth
- };
- TimelineSource(const QString &who, RequestType requestType, QObject* parent);
- Index: kdeplasma-addons-4.3.80/dataengines/microblog/twitterengine.cpp
- ===================================================================
- --- kdeplasma-addons-4.3.80.orig/dataengines/microblog/twitterengine.cpp 2009-12-05 16:53:37.749272739 +0100
- +++ kdeplasma-addons-4.3.80/dataengines/microblog/twitterengine.cpp 2009-12-05 17:11:23.330118912 +0100
- @@ -30,6 +30,7 @@
- const QString TwitterEngine::timelinePrefix("Timeline:");
- const QString TwitterEngine::timelineWithFriendsPrefix("TimelineWithFriends:");
- const QString TwitterEngine::profilePrefix("Profile:");
- +const QString TwitterEngine::noauthPrefix("NoAuth:");
- const QString TwitterEngine::repliesPrefix("Replies:");
- const QString TwitterEngine::messagesPrefix("Messages:");
- @@ -53,7 +54,7 @@
- if (!name.startsWith(timelinePrefix) && !name.startsWith(timelineWithFriendsPrefix)
- && !name.startsWith(profilePrefix) && !name.startsWith(repliesPrefix)
- - && !name.startsWith(messagesPrefix)) {
- + && !name.startsWith(messagesPrefix)) && !name.startsWith(noauthPrefix)) {
- return false;
- }
- @@ -85,7 +86,7 @@
- //right now it only makes sense to do an update on timelines
- if (!name.startsWith(timelinePrefix) && !name.startsWith(timelineWithFriendsPrefix)
- && !name.startsWith(profilePrefix) && !name.startsWith(repliesPrefix)
- - && !name.startsWith(messagesPrefix)) {
- + && !name.startsWith(messagesPrefix)) && !name.startsWith(noauthPrefix)) {
- return false;
- }
- @@ -98,6 +99,9 @@
- } else if (name.startsWith(profilePrefix)) {
- requestType = TimelineSource::Profile;
- who.remove(profilePrefix);
- + } else if (name.startsWith(noauthPrefix)) {
- + requestType = TimelineSource::NoAuth;
- + who.remove(noauthPrefix);
- } else if (name.startsWith(repliesPrefix)) {
- requestType = TimelineSource::Replies;
- who.remove(repliesPrefix);
- Index: kdeplasma-addons-4.3.80/dataengines/microblog/twitterengine.h
- ===================================================================
- --- kdeplasma-addons-4.3.80.orig/dataengines/microblog/twitterengine.h 2009-12-05 16:53:37.739271794 +0100
- +++ kdeplasma-addons-4.3.80/dataengines/microblog/twitterengine.h 2009-12-05 17:11:36.771145538 +0100
- @@ -67,6 +67,7 @@
- static const QString timelinePrefix;
- static const QString timelineWithFriendsPrefix;
- static const QString profilePrefix;
- + static const QString noauthPrefix;
- static const QString repliesPrefix;
- static const QString messagesPrefix;
- ImageSource *m_imageSource;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement