|
Lines 1662-1675
Link Here
|
| 1662 |
TQString path = TQString::fromLatin1("/sbin:/bin"); |
1662 |
TQString path = TQString::fromLatin1("/sbin:/bin"); |
| 1663 |
if (!epath.isEmpty()) |
1663 |
if (!epath.isEmpty()) |
| 1664 |
path += ":" + epath; |
1664 |
path += ":" + epath; |
| 1665 |
TQString pmountProg = TDEGlobal::dirs()->findExe("pmount", path); |
|
|
| 1666 |
|
| 1667 |
if (pmountProg.isEmpty()) |
| 1668 |
return false; |
| 1669 |
|
1665 |
|
|
|
1666 |
TQString mountProg; |
| 1670 |
TQCString buffer; |
1667 |
TQCString buffer; |
| 1671 |
buffer.sprintf( "%s %s", TQFile::encodeName(pmountProg).data(), |
1668 |
|
|
|
1669 |
// Use 'pmount', if available |
| 1670 |
mountProg = TDEGlobal::dirs()->findExe("pmount", path); |
| 1671 |
if (!mountProg.isEmpty()) { |
| 1672 |
buffer.sprintf( "%s %s", TQFile::encodeName(mountProg).data(), |
| 1672 |
TQFile::encodeName(TDEProcess::quote(dev)).data() ); |
1673 |
TQFile::encodeName(TDEProcess::quote(dev)).data() ); |
|
|
1674 |
} |
| 1675 |
|
| 1676 |
#ifdef WITH_UDISKS2 |
| 1677 |
// Use 'udisksctl' (UDISKS2) if available |
| 1678 |
if (mountProg.isEmpty()) { |
| 1679 |
mountProg = TDEGlobal::dirs()->findExe("udisksctl", path); |
| 1680 |
if (!mountProg.isEmpty()) { |
| 1681 |
buffer.sprintf( "%s mount -b %s", TQFile::encodeName(mountProg).data(), |
| 1682 |
TQFile::encodeName(TDEProcess::quote(dev)).data() ); |
| 1683 |
} |
| 1684 |
} |
| 1685 |
#endif // WITH_UDISKS2 |
| 1686 |
|
| 1687 |
#ifdef WITH_UDISKS |
| 1688 |
// Use 'udisks' (UDISKS1) if available |
| 1689 |
if (mountProg.isEmpty()) { |
| 1690 |
mountProg = TDEGlobal::dirs()->findExe("udisks", path); |
| 1691 |
if (!mountProg.isEmpty()) { |
| 1692 |
buffer.sprintf( "%s --mount %s", TQFile::encodeName(mountProg).data(), |
| 1693 |
TQFile::encodeName(TDEProcess::quote(dev)).data() ); |
| 1694 |
} |
| 1695 |
} |
| 1696 |
#endif // WITH_UDISKS |
| 1697 |
|
| 1698 |
if (mountProg.isEmpty()) { |
| 1699 |
return false; |
| 1700 |
} |
| 1673 |
|
1701 |
|
| 1674 |
int res = system( buffer.data() ); |
1702 |
int res = system( buffer.data() ); |
| 1675 |
|
1703 |
|
|
Lines 1704-1717
Link Here
|
| 1704 |
TQString path = TQString::fromLatin1("/sbin:/bin"); |
1732 |
TQString path = TQString::fromLatin1("/sbin:/bin"); |
| 1705 |
if (!epath.isEmpty()) |
1733 |
if (!epath.isEmpty()) |
| 1706 |
path += ":" + epath; |
1734 |
path += ":" + epath; |
| 1707 |
TQString pumountProg = TDEGlobal::dirs()->findExe("pumount", path); |
1735 |
|
|
|
1736 |
TQString umountProg; |
| 1737 |
TQCString buffer; |
| 1708 |
|
1738 |
|
| 1709 |
if (pumountProg.isEmpty()) |
1739 |
// Use 'pumount', if available |
| 1710 |
return false; |
1740 |
umountProg = TDEGlobal::dirs()->findExe("pumount", path); |
|
|
1741 |
if (!umountProg.isEmpty()) { |
| 1742 |
buffer.sprintf( "%s %s", TQFile::encodeName(umountProg).data(), |
| 1743 |
TQFile::encodeName(TDEProcess::quote(dev)).data() ); |
| 1744 |
} |
| 1711 |
|
1745 |
|
| 1712 |
TQCString buffer; |
1746 |
#ifdef WITH_UDISKS2 |
| 1713 |
buffer.sprintf( "%s %s", TQFile::encodeName(pumountProg).data(), |
1747 |
// Use 'udisksctl' (UDISKS2), if available |
|
|
1748 |
if (umountProg.isEmpty()) { |
| 1749 |
umountProg = TDEGlobal::dirs()->findExe("udisksctl", path); |
| 1750 |
if (!umountProg.isEmpty()) { |
| 1751 |
buffer.sprintf( "%s unmount -b %s", TQFile::encodeName(umountProg).data(), |
| 1752 |
TQFile::encodeName(TDEProcess::quote(dev)).data() ); |
| 1753 |
} |
| 1754 |
} |
| 1755 |
#endif // WITH_UDISKS2 |
| 1756 |
|
| 1757 |
#ifdef WITH_UDISKS |
| 1758 |
// Use 'udisks' (UDISKS1), if available |
| 1759 |
if (umountProg.isEmpty()) { |
| 1760 |
umountProg = TDEGlobal::dirs()->findExe("udisks", path); |
| 1761 |
if (!umountProg.isEmpty()) { |
| 1762 |
buffer.sprintf( "%s --unmount %s", TQFile::encodeName(umountProg).data(), |
| 1714 |
TQFile::encodeName(TDEProcess::quote(dev)).data() ); |
1763 |
TQFile::encodeName(TDEProcess::quote(dev)).data() ); |
|
|
1764 |
} |
| 1765 |
} |
| 1766 |
#endif // WITH_UDISKS |
| 1767 |
|
| 1768 |
if (umountProg.isEmpty()) { |
| 1769 |
return false; |
| 1770 |
} |
| 1715 |
|
1771 |
|
| 1716 |
int res = system( buffer.data() ); |
1772 |
int res = system( buffer.data() ); |
| 1717 |
|
1773 |
|