Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 188760
Collapse All | Expand All

(-)./klaptopdaemon/portable.cpp.old (-17 / +4 lines)
Lines 690-704 has_acpi_sleep(int state) Link Here
690
		mask = 0;
690
		mask = 0;
691
691
692
		QFile p("/sys/power/state");
692
		QFile p("/sys/power/state");
693
		QFile f("/proc/acpi/sleep");
694
693
695
		if (p.open(IO_ReadOnly)) {
694
		if (p.open(IO_ReadOnly)) {
695
			QTextStream stream(&p);
696
			QString l;
696
			QString l;
697
			p.readLine(l,500);
697
			l = stream.readLine();
698
698
			QStringList ll = QStringList::split(' ',l,false);
699
			QStringList ll = QStringList::split(' ',l,false);
699
			for (QValueListIterator<QString> i = ll.begin(); i!=ll.end(); i++) {
700
			for (QValueListIterator<QString> i = ll.begin(); i!=ll.end(); i++) {
700
				QString s = *i;
701
				QString s = *i;
701
				
702
702
				if (s.compare("standby")==0)
703
				if (s.compare("standby")==0)
703
				mask |= (1<<1);
704
				mask |= (1<<1);
704
				else if (s.compare("mem")==0)
705
				else if (s.compare("mem")==0)
Lines 708-727 has_acpi_sleep(int state) Link Here
708
			}
709
			}
709
			p.close();
710
			p.close();
710
		}
711
		}
711
		else if (f.open(IO_ReadOnly)) {
712
			QString l;
713
			f.readLine(l, 500);
714
			QStringList ll = QStringList::split(' ',l,false);
715
			for (QValueListIterator<QString> i = ll.begin(); i!=ll.end(); i++) {
716
				QString s = *i;
717
				if (s[0] == 'S') {
718
					int c = s[1].digitValue();
719
					if (c >= 0 && c <= 9)
720
						mask |= 1<<c;
721
				}
722
			}
723
			f.close();
724
		}
725
	}
712
	}
726
	return((mask&acpi_sleep_enabled&(1<<state)) != 0);
713
	return((mask&acpi_sleep_enabled&(1<<state)) != 0);
727
}
714
}

Return to bug 188760