KRandRTray fixes; minor compilation repairs

git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1152360 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
v3.5.13-sru
tpearson 15 years ago
parent e7c20618e6
commit 42dfcbcc0f

@ -21,12 +21,11 @@
#ifndef _KDIALOG_H_
#define _KDIALOG_H_
class QLayoutItem;
#include <qdialog.h>
#include <kdelibs_export.h>
class QLayoutItem;
/**
* Dialog with extended non-modal support and methods for %KDE standard
* compliance.

@ -24,12 +24,12 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#ifndef __kpanelapplet_h__
#define __kpanelapplet_h__
class KConfig;
class QPopupMenu;
#include <qframe.h>
#include <kconfig.h>
class KConfig;
class QPopupMenu;
/**
* @short %KDE Panel Applet class
*

@ -24,14 +24,13 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#ifndef __kpanelextension_h__
#define __kpanelextension_h__
#include <qframe.h>
#include <kdelibs_export.h>
class QPopupMenu;
class KConfig;
class KPanelExtensionPrivate;
#include <qframe.h>
#include <kdelibs_export.h>
/**
* @short %KDE Panel Extension class
*

@ -20,10 +20,12 @@
#ifndef _THUMBCREATOR_H_
#define _THUMBCREATOR_H_
#include <qstring.h>
class QString;
class QImage;
/**
* This is the baseclass for "thumbnail-plugins" in KDE. Using the class
* This is the baseclass for "thumbnail-plugins" in KDE. Using the class
* KIO::PreviewJob allows you to generate small images (thumbnails)
* for any kind of file, where a "ThumbCreator" is available. Have a look
* at kdebase/kioslave/thumbnail/ for existing ThumbCreators.

@ -24,6 +24,7 @@
#ifndef _KJS_USTRING_H_
#define _KJS_USTRING_H_
#include <qstring.h>
#include "global.h"
/**

@ -90,6 +90,9 @@ QString KRandrSimpleAPI::applyIccFile(QString screenName, QString fileName) {
screenNumber = -1;
randr_display = XOpenDisplay(NULL);
randr_screen_info = read_screen_info(randr_display);
if (randr_screen_info == NULL) {
return "";
}
j=0;
for (i = 0; i < randr_screen_info->n_output; i++) {
output_info = randr_screen_info->outputs[i]->info;
@ -151,6 +154,9 @@ QString KRandrSimpleAPI::applyIccFile(QString screenName, QString fileName) {
screenNumber = -1;
randr_display = XOpenDisplay(NULL);
randr_screen_info = read_screen_info(randr_display);
if (randr_screen_info == NULL) {
return "";
}
j=0;
for (i = 0; i < randr_screen_info->n_output; i++) {
output_info = randr_screen_info->outputs[i]->info;
@ -216,6 +222,9 @@ QString KRandrSimpleAPI::applyIccConfiguration(QString profileName, QString kde_
if (isValid() == true) {
randr_display = XOpenDisplay(NULL);
randr_screen_info = read_screen_info(randr_display);
if (randr_screen_info == NULL) {
return "";
}
for (i = 0; i < randr_screen_info->n_output; i++) {
output_info = randr_screen_info->outputs[i]->info;
errorstr = applyIccFile(output_info->name, getIccFileName(profileName, output_info->name, kde_confdir));

@ -384,6 +384,10 @@ struct ScreenInfo* internal_read_screen_info (Display *display)
sr = XRRGetScreenResources (display, root_window);
if (sr == NULL) {
return NULL;
}
screen_info = malloc (sizeof (struct ScreenInfo));
screen_info->dpy = display;
screen_info->window = root_window;

@ -562,6 +562,20 @@ RandRDisplay::RandRDisplay()
return;
}
// Sometimes the extension is available but does not return any screens (!)
// Check for that case
Display *randr_display = XOpenDisplay(NULL);
int screen_num;
Window root_window;
screen_num = DefaultScreen (randr_display);
root_window = RootWindow (randr_display, screen_num);
if (XRRGetScreenResources (randr_display, root_window) == NULL) {
m_errorCode = i18n("No screens detected");
m_valid = false;
return;
}
int major_version, minor_version;
XRRQueryVersion(qt_xdisplay(), &major_version, &minor_version);

Loading…
Cancel
Save