View | Details | Raw Unified
Collapse All | Expand All

(-) ./klaptopdaemon/portable.cpp.old (-17 / +4 lines)
 Lines 690-704   has_acpi_sleep(int state) Link Here 
		mask = 0;
		mask = 0;
		QFile p("/sys/power/state");
		QFile p("/sys/power/state");
		QFile f("/proc/acpi/sleep");
		if (p.open(IO_ReadOnly)) {
		if (p.open(IO_ReadOnly)) {
			QTextStream stream(&p);
			QString l;
			QString l;
			p.readLine(l,500);
			l = stream.readLine();
			QStringList ll = QStringList::split(' ',l,false);
			QStringList ll = QStringList::split(' ',l,false);
			for (QValueListIterator<QString> i = ll.begin(); i!=ll.end(); i++) {
			for (QValueListIterator<QString> i = ll.begin(); i!=ll.end(); i++) {
				QString s = *i;
				QString s = *i;
				
				if (s.compare("standby")==0)
				if (s.compare("standby")==0)
				mask |= (1<<1);
				mask |= (1<<1);
				else if (s.compare("mem")==0)
				else if (s.compare("mem")==0)
 Lines 708-727   has_acpi_sleep(int state) Link Here 
			}
			}
			p.close();
			p.close();
		}
		}
		else if (f.open(IO_ReadOnly)) {
			QString l;
			f.readLine(l, 500);
			QStringList ll = QStringList::split(' ',l,false);
			for (QValueListIterator<QString> i = ll.begin(); i!=ll.end(); i++) {
				QString s = *i;
				if (s[0] == 'S') {
					int c = s[1].digitValue();
					if (c >= 0 && c <= 9)
						mask |= 1<<c;
				}
			}
			f.close();
		}
	}
	}
	return((mask&acpi_sleep_enabled&(1<<state)) != 0);
	return((mask&acpi_sleep_enabled&(1<<state)) != 0);
}
}