Advertisement
Guest User

quintasan

a guest
Dec 5th, 2009
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.96 KB | None | 0 0
  1. Index: kdeplasma-addons-4.3.80/applets/microblog/microblog.cpp
  2. ===================================================================
  3. --- kdeplasma-addons-4.3.80.orig/applets/microblog/microblog.cpp 2009-12-05 16:52:57.999271256 +0100
  4. +++ kdeplasma-addons-4.3.80/applets/microblog/microblog.cpp 2009-12-05 17:04:30.729271246 +0100
  5. @@ -27,6 +27,7 @@
  6. #include <QGraphicsAnchorLayout>
  7. #include <QAction>
  8. #include <QTimer>
  9. +#include <QFile>
  10.  
  11. #include <KColorScheme>
  12. #include <KConfigDialog>
  13. @@ -164,7 +165,7 @@
  14. m_serviceUrl = cg.readEntry("serviceUrl", "https://identi.ca/api/");
  15. m_username = cg.readEntry("username");
  16. m_password = KStringHandler::obscure(cg.readEntry("password"));
  17. - m_historySize = cg.readEntry("historySize", 6);
  18. + m_historySize = cg.readEntry("historySize", 10);
  19. m_historyRefresh = cg.readEntry("historyRefresh", 5);
  20. m_includeFriends = cg.readEntry("includeFriends", true);
  21.  
  22. @@ -202,8 +203,10 @@
  23. m_layout->addItem(flashLayout);
  24.  
  25. m_headerFrame = new Plasma::Frame(this);
  26. - m_headerLayout = new QGraphicsAnchorLayout(m_headerFrame);
  27. + m_headerLayout = new QGraphicsLinearLayout( Qt::Horizontal, m_headerFrame );
  28. m_headerLayout->setSpacing( 5 );
  29. +
  30. + m_layout->addItem( m_headerFrame );
  31.  
  32. m_icon = new Plasma::IconWidget(m_headerFrame);
  33. m_icon->setIcon(KIcon("user-identity"));
  34. @@ -261,6 +264,7 @@
  35. //set things in motion
  36. if (m_username.isEmpty()) {
  37. setAuthRequired(true);
  38. + downloadHistory();
  39. } else if (m_password.isEmpty()) {
  40. kDebug() << "started, password is not in config file, trying wallet";
  41. m_walletWait = Read;
  42. @@ -351,7 +355,9 @@
  43. } else if (m_password.isEmpty()) {
  44. //FIXME: when out of string freeze, tell the user WHY they need
  45. // to configure the widget;
  46. - setConfigurationRequired(true);
  47. + if (!QFile::exists("/usr/bin/ubiquity")) { //don't show on live CD
  48. + setConfigurationRequired(true);
  49. + }
  50. kDebug() << "failed to read password";
  51. }
  52.  
  53. @@ -376,7 +382,9 @@
  54.  
  55. void MicroBlog::setAuthRequired(bool required)
  56. {
  57. - setConfigurationRequired(required);
  58. + if (!QFile::exists("/usr/bin/ubiquity")) {
  59. + setConfigurationRequired(required);
  60. + }
  61. m_statusEdit->setEnabled(!required);
  62. }
  63.  
  64. @@ -752,11 +760,18 @@
  65. {
  66. //kDebug() ;
  67. if (m_username.isEmpty() || m_password.isEmpty()) {
  68. + /*
  69. if (!m_curTimeline.isEmpty()) {
  70. m_engine->disconnectSource(m_curTimeline, this);
  71. m_engine->disconnectSource("Error:" + m_curTimeline, this);
  72. }
  73. return;
  74. + */
  75. + m_username = "kubuntu"; //default to show when unconfigured
  76. + m_headerFrame->hide();
  77. + } else {
  78. + m_headerFrame->show();
  79. + }
  80. }
  81.  
  82. m_flash->flash(i18n("Refreshing timeline..."), -1);
  83. @@ -767,7 +782,9 @@
  84. } else {
  85. createTimelineService();
  86. KConfigGroup cg = m_service->operationDescription("auth");
  87. - cg.writeEntry("password", m_password);
  88. + if (!m_password.isEmpty()) {
  89. + cg.writeEntry("password", m_password);
  90. + }
  91. m_service->startOperationCall(cg);
  92. }
  93.  
  94. Index: kdeplasma-addons-4.3.80/applets/microblog/microblog.h
  95. ===================================================================
  96. --- kdeplasma-addons-4.3.80.orig/applets/microblog/microblog.h 2009-12-05 16:52:57.989272846 +0100
  97. +++ kdeplasma-addons-4.3.80/applets/microblog/microblog.h 2009-12-05 17:05:16.059272118 +0100
  98. @@ -137,7 +137,8 @@
  99. QGraphicsWidget *m_tweetsWidget;
  100. QGraphicsLinearLayout *m_tweetsLayout;
  101. QGraphicsLinearLayout *m_layout;
  102. - QGraphicsAnchorLayout *m_headerLayout;
  103. + QGraphicsAnchorLayout *m_headerLayout;
  104. + Plasma::Frame *m_headerFrame;
  105. QGraphicsWidget *m_graphicsWidget;
  106. QPixmap m_popupIcon;
  107.  
  108. Index: kdeplasma-addons-4.3.80/dataengines/microblog/timelinesource.cpp
  109. ===================================================================
  110. --- kdeplasma-addons-4.3.80.orig/dataengines/microblog/timelinesource.cpp 2009-12-05 16:53:23.151146460 +0100
  111. +++ kdeplasma-addons-4.3.80/dataengines/microblog/timelinesource.cpp 2009-12-05 17:07:09.699272171 +0100
  112. @@ -97,6 +97,9 @@
  113. case TimelineWithFriends:
  114. m_url = KUrl(m_serviceBaseUrl, "statuses/friends_timeline.xml");
  115. break;
  116. + case NoAuth:
  117. + m_url = KUrl(m_serviceBaseUrl, QString("statuses/user_timeline/%1.xml").arg(account.at(0)));
  118. + break;
  119. case Timeline:
  120. default:
  121. m_url = KUrl(m_serviceBaseUrl, "statuses/user_timeline.xml");
  122. @@ -141,7 +144,7 @@
  123.  
  124. void TimelineSource::update(bool forcedUpdate)
  125. {
  126. - if (m_job || (!account().isEmpty() && password().isEmpty())) {
  127. + if ( account() != "kubuntu" && (m_job || (!account().isEmpty() &&password().isEmpty())) ) {
  128. // We are already performing a fetch, let's not bother starting over
  129. //kDebug() << "already updating....." << m_job << account().isEmpty() << password().isEmpty();
  130. return;
  131. Index: kdeplasma-addons-4.3.80/dataengines/microblog/timelinesource.h
  132. ===================================================================
  133. --- kdeplasma-addons-4.3.80.orig/dataengines/microblog/timelinesource.h 2009-12-05 16:53:23.140644082 +0100
  134. +++ kdeplasma-addons-4.3.80/dataengines/microblog/timelinesource.h 2009-12-05 17:07:36.170510838 +0100
  135. @@ -80,7 +80,8 @@
  136. TimelineWithFriends,
  137. Replies,
  138. DirectMessages,
  139. - Profile
  140. + Profile,
  141. + NoAuth
  142. };
  143.  
  144. TimelineSource(const QString &who, RequestType requestType, QObject* parent);
  145. Index: kdeplasma-addons-4.3.80/dataengines/microblog/twitterengine.cpp
  146. ===================================================================
  147. --- kdeplasma-addons-4.3.80.orig/dataengines/microblog/twitterengine.cpp 2009-12-05 16:53:37.749272739 +0100
  148. +++ kdeplasma-addons-4.3.80/dataengines/microblog/twitterengine.cpp 2009-12-05 17:11:23.330118912 +0100
  149. @@ -30,6 +30,7 @@
  150. const QString TwitterEngine::timelinePrefix("Timeline:");
  151. const QString TwitterEngine::timelineWithFriendsPrefix("TimelineWithFriends:");
  152. const QString TwitterEngine::profilePrefix("Profile:");
  153. +const QString TwitterEngine::noauthPrefix("NoAuth:");
  154. const QString TwitterEngine::repliesPrefix("Replies:");
  155. const QString TwitterEngine::messagesPrefix("Messages:");
  156.  
  157. @@ -53,7 +54,7 @@
  158.  
  159. if (!name.startsWith(timelinePrefix) && !name.startsWith(timelineWithFriendsPrefix)
  160. && !name.startsWith(profilePrefix) && !name.startsWith(repliesPrefix)
  161. - && !name.startsWith(messagesPrefix)) {
  162. + && !name.startsWith(messagesPrefix)) && !name.startsWith(noauthPrefix)) {
  163. return false;
  164. }
  165.  
  166. @@ -85,7 +86,7 @@
  167. //right now it only makes sense to do an update on timelines
  168. if (!name.startsWith(timelinePrefix) && !name.startsWith(timelineWithFriendsPrefix)
  169. && !name.startsWith(profilePrefix) && !name.startsWith(repliesPrefix)
  170. - && !name.startsWith(messagesPrefix)) {
  171. + && !name.startsWith(messagesPrefix)) && !name.startsWith(noauthPrefix)) {
  172. return false;
  173. }
  174.  
  175. @@ -98,6 +99,9 @@
  176. } else if (name.startsWith(profilePrefix)) {
  177. requestType = TimelineSource::Profile;
  178. who.remove(profilePrefix);
  179. + } else if (name.startsWith(noauthPrefix)) {
  180. + requestType = TimelineSource::NoAuth;
  181. + who.remove(noauthPrefix);
  182. } else if (name.startsWith(repliesPrefix)) {
  183. requestType = TimelineSource::Replies;
  184. who.remove(repliesPrefix);
  185. Index: kdeplasma-addons-4.3.80/dataengines/microblog/twitterengine.h
  186. ===================================================================
  187. --- kdeplasma-addons-4.3.80.orig/dataengines/microblog/twitterengine.h 2009-12-05 16:53:37.739271794 +0100
  188. +++ kdeplasma-addons-4.3.80/dataengines/microblog/twitterengine.h 2009-12-05 17:11:36.771145538 +0100
  189. @@ -67,6 +67,7 @@
  190. static const QString timelinePrefix;
  191. static const QString timelineWithFriendsPrefix;
  192. static const QString profilePrefix;
  193. + static const QString noauthPrefix;
  194. static const QString repliesPrefix;
  195. static const QString messagesPrefix;
  196. ImageSource *m_imageSource;
  197.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement