Changeset View
Changeset View
Standalone View
Standalone View
src/kaboutapplicationpersonlistdelegate_p.cpp
Show First 20 Lines • Show All 118 Lines • ▼ Show 20 Line(s) | 97 | { | |||
---|---|---|---|---|---|
119 | //And now we fill in the main links (email + homepage + OCS profile)... | 119 | //And now we fill in the main links (email + homepage + OCS profile)... | ||
120 | KToolBar *mainLinks = qobject_cast< KToolBar * >(widgets.at(MainLinks)); | 120 | KToolBar *mainLinks = qobject_cast< KToolBar * >(widgets.at(MainLinks)); | ||
121 | mainLinks->setIconSize(QSize(22, 22)); | 121 | mainLinks->setIconSize(QSize(22, 22)); | ||
122 | mainLinks->setContentsMargins(0, 0, 0, 0); | 122 | mainLinks->setContentsMargins(0, 0, 0, 0); | ||
123 | mainLinks->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); | 123 | mainLinks->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); | ||
124 | QAction *action; | 124 | QAction *action; | ||
125 | if (!profile.email().isEmpty()) { | 125 | if (!profile.email().isEmpty()) { | ||
126 | action = mainLinks->actions().at(EmailAction); | 126 | action = mainLinks->actions().at(EmailAction); | ||
127 | action->setToolTip(i18nc("Action to send an email to a contributor", | 127 | action->setToolTip(i18nc("@info:tooltip Action to send an email to a contributor", | ||
128 | "Email contributor\n%1", profile.email())); | 128 | "Email contributor\n%1", profile.email())); | ||
129 | action->setData(QString(QLatin1String("mailto:") + profile.email())); | 129 | action->setData(QString(QLatin1String("mailto:") + profile.email())); | ||
130 | action->setVisible(true); | 130 | action->setVisible(true); | ||
131 | } | 131 | } | ||
132 | if (!profile.homepage().isEmpty()) { | 132 | if (!profile.homepage().isEmpty()) { | ||
133 | action = mainLinks->actions().at(HomepageAction); | 133 | action = mainLinks->actions().at(HomepageAction); | ||
134 | action->setToolTip(i18n("Visit contributor's homepage\n%1", profile.homepage().toString())); | 134 | action->setToolTip(i18nc("@info:tooltip", "Visit contributor's homepage\n%1", profile.homepage().toString())); | ||
135 | action->setData(profile.homepage().toString()); | 135 | action->setData(profile.homepage().toString()); | ||
136 | action->setVisible(true); | 136 | action->setVisible(true); | ||
137 | } | 137 | } | ||
138 | if (!profile.ocsProfileUrl().isEmpty()) { | 138 | if (!profile.ocsProfileUrl().isEmpty()) { | ||
139 | action = mainLinks->actions().at(VisitProfileAction); | 139 | action = mainLinks->actions().at(VisitProfileAction); | ||
140 | KAboutApplicationPersonModel *model = qobject_cast< KAboutApplicationPersonModel * >(itemView()->model()); | 140 | KAboutApplicationPersonModel *model = qobject_cast< KAboutApplicationPersonModel * >(itemView()->model()); | ||
141 | action->setToolTip(i18n("Visit contributor's profile on %1\n%2", | 141 | action->setToolTip(i18nc("@info:tooltip", "Visit contributor's profile on %1\n%2", | ||
142 | model->providerName(), | 142 | model->providerName(), | ||
143 | profile.ocsProfileUrl())); | 143 | profile.ocsProfileUrl())); | ||
144 | action->setData(profile.ocsProfileUrl()); | 144 | action->setData(profile.ocsProfileUrl()); | ||
145 | action->setVisible(true); | 145 | action->setVisible(true); | ||
146 | } | 146 | } | ||
147 | mainLinks->resize(QSize(mainLinks->sizeHint().width(), MAIN_LINKS_HEIGHT)); | 147 | mainLinks->resize(QSize(mainLinks->sizeHint().width(), MAIN_LINKS_HEIGHT)); | ||
148 | mainLinks->move(wRect.left(), wRect.top() + label->height()); | 148 | mainLinks->move(wRect.left(), wRect.top() + label->height()); | ||
149 | 149 | | |||
150 | //Finally, the social links... | 150 | //Finally, the social links... | ||
151 | KToolBar *socialLinks = qobject_cast< KToolBar * >(widgets.at(SocialLinks)); | 151 | KToolBar *socialLinks = qobject_cast< KToolBar * >(widgets.at(SocialLinks)); | ||
152 | socialLinks->setIconSize(QSize(16, 16)); | 152 | socialLinks->setIconSize(QSize(16, 16)); | ||
153 | socialLinks->setContentsMargins(0, 0, 0, 0); | 153 | socialLinks->setContentsMargins(0, 0, 0, 0); | ||
154 | socialLinks->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); | 154 | socialLinks->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); | ||
155 | 155 | | |||
156 | int currentSocialLinkAction = 0; | 156 | int currentSocialLinkAction = 0; | ||
157 | const auto links = profile.ocsLinks(); | 157 | const auto links = profile.ocsLinks(); | ||
158 | for (const KAboutApplicationPersonProfileOcsLink &link : links) { | 158 | for (const KAboutApplicationPersonProfileOcsLink &link : links) { | ||
159 | if (!profile.homepage().isEmpty() && profile.homepage() == link.url()) { | 159 | if (!profile.homepage().isEmpty() && profile.homepage() == link.url()) { | ||
160 | continue; //We skip it if it's the same as the homepage from KAboutData | 160 | continue; //We skip it if it's the same as the homepage from KAboutData | ||
161 | } | 161 | } | ||
162 | 162 | | |||
163 | action = socialLinks->actions().at(currentSocialLinkAction); | 163 | action = socialLinks->actions().at(currentSocialLinkAction); | ||
164 | if (link.type() == KAboutApplicationPersonProfileOcsLink::Other) { | 164 | if (link.type() == KAboutApplicationPersonProfileOcsLink::Other) { | ||
165 | action->setToolTip(i18n("Visit contributor's page\n%1", | 165 | action->setToolTip(i18nc("@info:tooltip", "Visit contributor's page\n%1", | ||
166 | link.url().toString())); | 166 | link.url().toString())); | ||
167 | } else if (link.type() == KAboutApplicationPersonProfileOcsLink::Blog) { | 167 | } else if (link.type() == KAboutApplicationPersonProfileOcsLink::Blog) { | ||
168 | action->setToolTip(i18n("Visit contributor's blog\n%1", | 168 | action->setToolTip(i18nc("@info:tooltip", "Visit contributor's blog\n%1", | ||
169 | link.url().toString())); | 169 | link.url().toString())); | ||
170 | } else if (link.type() == KAboutApplicationPersonProfileOcsLink::Homepage) { | 170 | } else if (link.type() == KAboutApplicationPersonProfileOcsLink::Homepage) { | ||
171 | action->setToolTip(i18n("Visit contributor's homepage\n%1", | 171 | action->setToolTip(i18nc("@info:tooltip", "Visit contributor's homepage\n%1", | ||
172 | link.url().toString())); | 172 | link.url().toString())); | ||
173 | } else { | 173 | } else { | ||
174 | action->setToolTip(i18n("Visit contributor's profile on %1\n%2", | 174 | action->setToolTip(i18nc("@info:tooltip", "Visit contributor's profile on %1\n%2", | ||
175 | link.prettyType(), | 175 | link.prettyType(), | ||
176 | link.url().toString())); | 176 | link.url().toString())); | ||
177 | } | 177 | } | ||
178 | action->setIcon(link.icon()); | 178 | action->setIcon(link.icon()); | ||
179 | action->setData(link.url().toString()); | 179 | action->setData(link.url().toString()); | ||
180 | action->setVisible(true); | 180 | action->setVisible(true); | ||
181 | 181 | | |||
182 | ++currentSocialLinkAction; | 182 | ++currentSocialLinkAction; | ||
▲ Show 20 Lines • Show All 125 Lines • Show Last 20 Lines |